Hi all. I'm in the progress of writing a program that has a few different classes and a couple of interfaces. I'm up to a part I don't really know how to do. In an " Item " class, users create Item instances, so, public Item(String name, double cost, int qty, boolean isFoodSource) { this.name = name; this.cost = cost; this.qty = qty this.isFoodSource = isFoodSource; } Item book = new Item("Cookbook", 10.25, 30, false); I have a Specials class which is like the one above. So, Specials mug = new Specials(..... Specials pen = new Specials(...... In another class, I have a list " stock " which implements the Stock interface. But my issue is that I'm having trouble iterating over the list. Users should add one Item thing they make like 'book' to the stock list, and can add several Specials things they make like 'mug' and 'pen' above. I need to iterate through it to do a few things. 1. throw an exception if two of the Item things are in it I know how to throw the exception part, just now the iterate to check for duplicate Item objects 2. I want to be able to get the Item 3. Check if all the things in the list are of non-food things So, In my Stock class I have some methods: public Item getItem() { returns the Item in the list } I've tried: public Item getItem() { Special t; Item b; for (int i = 0; i < stock.size(); i++) { if(ingredients.contains(t)) { if(t instanceof Item){ b = (Item)t; } } } return b; } Something obviously not right there. For the checking... I don't know how to do that, but I have public boolean isNotFoodSource () { returns true iff all the elements of a list are not of a food source } Thanks in advance. Let me know if you need more code to clarify any weird bits. P.S. I know that hashsets are used to remove/avoid duplicates. My main concern is that a duplicate Item element from the stock list is caught and an error is thrown - I don't want to remove it, or not allow it in the first place... I just want to throw the error :) I believe this should be done in the constructor, iterating using a for loop and doing an if ...?? I don't want a try catch block, I will just do a declaration in the constructor Thanks