@Override
    public Spliterator<T> trySplit() {
        if (sizeEstimate > 1 && iterator.hasNext()) {
            int batchSize = nextBatchSize();
            if (batchSize == 1) {
                final T item = iterator.next();
                if (sizeEstimate != Long.MAX_VALUE) {
                    sizeEstimate--;
                }
                return new SingletonSpliterator<>(item, characteristics);
            } else {
                final Object[] array = new Object[batchSize];
                int noRead = 0;
                do {
                    array[noRead] = iterator.next();
                } while (++noRead < batchSize && iterator.hasNext());
                if (sizeEstimate != Long.MAX_VALUE) {
                    sizeEstimate -= noRead;
                }

                return new ArraySpliterator<>(array, 0, noRead, characteristics);
            }
        }
        return null;
    }
Creates a {@link Spliterator} using the given iterator for traversal, and
reporting the given characteristics. The size is unknown.

@param iterator the iterator for the source
@param characteristics properties of this {@link Spliterator}'s source or
elements.
@param batchSizes the batch sizes to use for pseudo parallelism
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/parallel/ConfigurableIteratorSpliteratorImpl.java