### Question:
RoundRobin implements Iterable<T> { @Override public Iterator<T> iterator() { return new Iterator<T>() { private final AtomicInteger index = new AtomicInteger(0); @Override public boolean hasNext() { return true; } @Override public synchronized T next() { int idx = index.getAndUpdate(x -> { if (x == Integer.MAX_VALUE) { return (x % items.size()) + 1; } else { return ++x; } }); return items.get(idx % items.size()); } @Override public void remove() { throw new IllegalArgumentException("remove not allowed"); } }; } RoundRobin(final List<T> coll); @Override Iterator<T> iterator();  }### Answer:
@Test public void iterator() { List<String> content = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { String item = iterator.next(); content.add(item); } Assert.assertEquals(list, content); }