@Test public void testPredictionZeroAndSomeOutstanding() { AtomicLong toRequest = new AtomicLong(5); OverlappingCapacityAwareEstimator supplier = newSupplier(toRequest::get); requestNAndVerify(supplier, 10, 5L); verify(supplier).getRequestNForCapacity(10); toRequest.set(0); requestNAndVerify(supplier, 10, 0L); verifyNoMoreInteractions(supplier); }
protected abstract long getRequestNForCapacity(long capacityToFill);
OverlappingCapacityAwareEstimator implements WriteDemandEstimator { protected abstract long getRequestNForCapacity(long capacityToFill); }
OverlappingCapacityAwareEstimator implements WriteDemandEstimator { protected abstract long getRequestNForCapacity(long capacityToFill); protected  OverlappingCapacityAwareEstimator(SizeEstimator sizeEstimator); }
OverlappingCapacityAwareEstimator implements WriteDemandEstimator { protected abstract long getRequestNForCapacity(long capacityToFill); protected  OverlappingCapacityAwareEstimator(SizeEstimator sizeEstimator); @Override final void onItemWrite(Object written, long writeBufferCapacityBeforeWrite,
                                  long writeBufferCapacityAfterWrite); @Override final long estimateRequestN(long writeBufferCapacityInBytes); }
OverlappingCapacityAwareEstimator implements WriteDemandEstimator { protected abstract long getRequestNForCapacity(long capacityToFill); protected  OverlappingCapacityAwareEstimator(SizeEstimator sizeEstimator); @Override final void onItemWrite(Object written, long writeBufferCapacityBeforeWrite,
                                  long writeBufferCapacityAfterWrite); @Override final long estimateRequestN(long writeBufferCapacityInBytes);  }