@Test public void testGetNextFromSingleValuePool() { FailoverUriPool pool = new FailoverUriPool(uris.subList(0, 1), null); assertEquals(uris.get(0), pool.getNext()); assertEquals(uris.get(0), pool.getNext()); assertEquals(uris.get(0), pool.getNext()); }
public URI getNext() { URI next = null; synchronized (uris) { if (!uris.isEmpty()) { next = uris.removeFirst(); uris.addLast(next); } } return next; }
FailoverUriPool { public URI getNext() { URI next = null; synchronized (uris) { if (!uris.isEmpty()) { next = uris.removeFirst(); uris.addLast(next); } } return next; } }
FailoverUriPool { public URI getNext() { URI next = null; synchronized (uris) { if (!uris.isEmpty()) { next = uris.removeFirst(); uris.addLast(next); } } return next; } FailoverUriPool();  FailoverUriPool(List<URI> uris, Map<String, String> nestedOptions); }
FailoverUriPool { public URI getNext() { URI next = null; synchronized (uris) { if (!uris.isEmpty()) { next = uris.removeFirst(); uris.addLast(next); } } return next; } FailoverUriPool();  FailoverUriPool(List<URI> uris, Map<String, String> nestedOptions); int size(); boolean isEmpty(); URI getNext(); void connected(); boolean isRandomize(); void setRandomize(boolean random); void add(URI uri); void addAll(List<URI> additions); void addFirst(URI uri); boolean remove(URI uri); void removeAll(); void replaceAll(List<URI> replacements); List<URI> getList(); Map<String, String> getNestedOptions(); @Override String toString(); }
FailoverUriPool { public URI getNext() { URI next = null; synchronized (uris) { if (!uris.isEmpty()) { next = uris.removeFirst(); uris.addLast(next); } } return next; } FailoverUriPool();  FailoverUriPool(List<URI> uris, Map<String, String> nestedOptions); int size(); boolean isEmpty(); URI getNext(); void connected(); boolean isRandomize(); void setRandomize(boolean random); void add(URI uri); void addAll(List<URI> additions); void addFirst(URI uri); boolean remove(URI uri); void removeAll(); void replaceAll(List<URI> replacements); List<URI> getList(); Map<String, String> getNestedOptions(); @Override String toString(); static final boolean DEFAULT_RANDOMIZE_ENABLED; }