### Question:
CoffeeGenerator implements Generator, Iterable<Coffee> { @Override public Iterator<Coffee> iterator() { return new CoffeeIterator(); } @SuppressWarnings("unused")  CoffeeGenerator();  CoffeeGenerator(int sz); @Override Iterator<Coffee> iterator(); @Override Coffee next();  }### Answer:
@Test public void testIterator() throws Exception { Iterator<Coffee> it = coffees.iterator(); ArrayList<Coffee> coffees1 = new ArrayList<Coffee>(); while (it.hasNext()) { coffees1.add(it.next()); } Assert.assertEquals(10, coffees1.size()); }