### Question:
ServerPool { public String getNext() { List<String> current = serverListRef.get(); return current.get(currentIndex.getAndIncrement() % current.size()); } ServerPool(List<String> serverList); String getNext();  }### Answer:
@Test public void returnsServersInOrder() { List<String> serverList = new ArrayList<>(); int iterations = new Random().nextInt(50) + 2; for (int i = 0; i < iterations; i++) { serverList.add(UUID.randomUUID().toString()); } ServerPool serverPool = new ServerPool(serverList); List<String> result = new ArrayList<>(); for (int i = 0; i < iterations; i++) { result.add(serverPool.getNext()); } for (int i = 0; i < iterations; i++) { assertEquals(serverList.get(i), result.get(i)); } }