Should work with this code
Item goldenapple = new Item(Item.GOLDEN_APPLE);
String[] shapeList = {" X ", "XYX", " X "};
HashMap<Character, Item> itemsToAdd = new HashMap<Character, Item>();
itemsToAdd.put('X', Item.get(Item.GOLD_IGNOT));
itemsToAdd.put('Y', Item.get(Item.APPLE))...