public ArrayList getRounds(String golferName, Date date) { ArrayList selected = new ArrayList(); ArrayList output = new ArrayList(); int roundCount = 0; for (Round r: rounds) { if ( roundCount == 20 ) { break; } if ( r.getName().equals(golferName) && ( r.getDate().compareTo(date) < 0 || r.getDate().compareTo(date) == 0 )) { selected.add(r); } roundCount++; } Collections.sort(selected); return output; }