@Test public void testEmptyPage() { final ArrayList<String> strings = Lists.newArrayList(); final Iterator<String> iterator = buildEmptyPage().iterable().iterator(); while (iterator.hasNext()) { String next = iterator.next(); strings.add(next); } assertTrue(strings.size() == 0); assertFalse(StringCollection.twoCalled); assertFalse(StringCollection.threeCalled); assertFalse(StringCollection.fetchPageCalled); }
public ResourceCollection<T> emptyPage() { if (empty == null) { empty = new ResourceCollectionEmpty<>(); } return empty; }
ResourceCollection { public ResourceCollection<T> emptyPage() { if (empty == null) { empty = new ResourceCollectionEmpty<>(); } return empty; } }
ResourceCollection { public ResourceCollection<T> emptyPage() { if (empty == null) { empty = new ResourceCollectionEmpty<>(); } return empty; } ResourceCollection(List<T> items, List<ResourceLink> links, NakadiClient client); }
ResourceCollection { public ResourceCollection<T> emptyPage() { if (empty == null) { empty = new ResourceCollectionEmpty<>(); } return empty; } ResourceCollection(List<T> items, List<ResourceLink> links, NakadiClient client); abstract ResourceCollection<T> fetchPage(String url); ResourceCollection<T> emptyPage(); ResourceCollection<T> nextPage(); List<T> items(); List<ResourceLink> links(); boolean hasNextLink(); Optional<URI> findLink(String rel); Iterable<T> iterable(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
ResourceCollection { public ResourceCollection<T> emptyPage() { if (empty == null) { empty = new ResourceCollectionEmpty<>(); } return empty; } ResourceCollection(List<T> items, List<ResourceLink> links, NakadiClient client); abstract ResourceCollection<T> fetchPage(String url); ResourceCollection<T> emptyPage(); ResourceCollection<T> nextPage(); List<T> items(); List<ResourceLink> links(); boolean hasNextLink(); Optional<URI> findLink(String rel); Iterable<T> iterable(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }