GrowableOffsetRangeTracker extends OffsetRangeTracker { @Override public IsBounded isBounded() { if (lastAttemptedOffset != null && lastAttemptedOffset == Long.MAX_VALUE) { return IsBounded.BOUNDED; } return range.getTo() == Long.MAX_VALUE ? IsBounded.UNBOUNDED : IsBounded.BOUNDED; } GrowableOffsetRangeTracker(long start, RangeEndEstimator rangeEndEstimator); @Override SplitResult<OffsetRange> trySplit(double fractionOfRemainder); @Override Progress getProgress(); @Override IsBounded isBounded();  }
@Test public void testIsBounded() throws Exception { SimpleEstimator simpleEstimator = new SimpleEstimator(); GrowableOffsetRangeTracker tracker = new GrowableOffsetRangeTracker(0L, simpleEstimator); assertEquals(IsBounded.UNBOUNDED, tracker.isBounded()); assertTrue(tracker.tryClaim(0L)); assertEquals(IsBounded.UNBOUNDED, tracker.isBounded()); simpleEstimator.setEstimateRangeEnd(16L); tracker.trySplit(0.5); assertEquals(IsBounded.BOUNDED, tracker.isBounded()); tracker = new GrowableOffsetRangeTracker(0L, simpleEstimator); tracker.tryClaim(Long.MAX_VALUE); assertEquals(IsBounded.BOUNDED, tracker.isBounded()); }