private long estimateSizeDuringBuffering() {
            synchronized (buffer) {
                int leftInBuffer = numberOfElementsLeftInBuffer();
                if (!buffering) // check again after having synchronized
                    return leftInBuffer;

                long estimateSize = leftInBuffer + source.estimateSize();
                // will overflow to negative number if source.estimateSize() reports Long.MAX_VALUE
                return estimateSize >= 0 ? estimateSize : Long.MAX_VALUE;
            }
        }
Returns the estimate size of this Spliterator.

Synchronized to get an accurate sum of <code>buffer.size()</code> and <code>source.estimateSize()</code>.
jOOL-java-8/src/main/java/org/jooq/lambda/SeqBuffer.java