ArraySpliterator implements Spliterator<T> { @Override public boolean tryAdvance(Consumer<? super T> action) { requireNonNull(action); if (index >= 0 && index < size) { @SuppressWarnings("unchecked") final T e = (T) array[index++]; action.accept(e); return true; } return false; } 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 testTryAdvance() { IntStream.range(0, SIZE).forEach(i -> assertTrue( instance.tryAdvance(DO_NOTHING), "error for:" + i)); assertFalse(instance.tryAdvance(DO_NOTHING)); }