@Test public void shouldReturnNextElement() { assertEquals("test1", fixture.get()); assertEquals("test2", fixture.get()); assertEquals("test1", fixture.get()); assertEquals("test2", fixture.get()); assertEquals("test1", fixture.get()); }
public synchronized T get() { if (iterator.hasNext()) { return iterator.next(); } else { iterator = elements.iterator(); return iterator.next(); } }
RoundRobinList { public synchronized T get() { if (iterator.hasNext()) { return iterator.next(); } else { iterator = elements.iterator(); return iterator.next(); } } }
RoundRobinList { public synchronized T get() { if (iterator.hasNext()) { return iterator.next(); } else { iterator = elements.iterator(); return iterator.next(); } } RoundRobinList(Collection<T> elements); }
RoundRobinList { public synchronized T get() { if (iterator.hasNext()) { return iterator.next(); } else { iterator = elements.iterator(); return iterator.next(); } } RoundRobinList(Collection<T> elements); synchronized T get(); int size(); }
RoundRobinList { public synchronized T get() { if (iterator.hasNext()) { return iterator.next(); } else { iterator = elements.iterator(); return iterator.next(); } } RoundRobinList(Collection<T> elements); synchronized T get(); int size();  }