ArraySpliterator implements Spliterator<T> { @Override public long estimateSize() { return (long) size - index; } ArraySpliterator(Object[] array, int additionalCharacteristics);   ArraySpliterator(Object[] array, int origin, int size, int additionalCharacteristics); @Override Spliterator<T> trySplit(); @SuppressWarnings("unchecked") @Override void forEachRemaining(Consumer<? super T> action); @Override boolean tryAdvance(Consumer<? super T> action); @Override long estimateSize(); @Override int characteristics(); @Override Comparator<? super T> getComparator();  }
@Test void testEstimateSize() { int remains = SIZE; for (int i = 0; i < SIZE; i++) { assertEquals(remains--, instance.estimateSize()); instance.tryAdvance(DO_NOTHING); } }