@Test public void testCreateWithoutLimitation() { Iterator<String> it = ImmutableList.of("str").iterator(); assertSame(it, ResultIterator.create(ResultIterator.OFFSET_NONE, ResultIterator.MAX_ALL, it)); }
public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator) { if (offset == OFFSET_NONE && max == MAX_ALL) { return iterator; } else { return new ResultIterator<>(offset, max, iterator); } }
ResultIterator implements Iterator<T> { public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator) { if (offset == OFFSET_NONE && max == MAX_ALL) { return iterator; } else { return new ResultIterator<>(offset, max, iterator); } } }
ResultIterator implements Iterator<T> { public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator) { if (offset == OFFSET_NONE && max == MAX_ALL) { return iterator; } else { return new ResultIterator<>(offset, max, iterator); } } private  ResultIterator(long offset, long max, Iterator<T> iterator); }
ResultIterator implements Iterator<T> { public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator) { if (offset == OFFSET_NONE && max == MAX_ALL) { return iterator; } else { return new ResultIterator<>(offset, max, iterator); } } private  ResultIterator(long offset, long max, Iterator<T> iterator); static Iterator<T> create(long offset, long max, Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove(); }
ResultIterator implements Iterator<T> { public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator) { if (offset == OFFSET_NONE && max == MAX_ALL) { return iterator; } else { return new ResultIterator<>(offset, max, iterator); } } private  ResultIterator(long offset, long max, Iterator<T> iterator); static Iterator<T> create(long offset, long max, Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove(); static final int OFFSET_NONE; static final int MAX_ALL; }