public void printUnsold() { ArrayList unsoldLots = getUnsold(); // Initialise arraylist// Make temporary arraylist for unsolt lots of type Lot for(Lot tmp : unsoldLots) { System.out.println(tmp.toString()); } } /** * Show only unsold */ public ArrayList getUnsold() { ArrayList unsoldLots = new ArrayList(); // Initialise arraylist// Make temporary arraylist for unsolt lots of type Lot Iterator it = lots.iterator(); // Iterate through lots abd refer to each temporary iteration as "it" while(it.hasNext()) { Lot tmpLot = it.next(); if (tmpLot.getHighestBid() == null) { unsoldLots.add(tmpLot); } } return unsoldLots; }