OffsetRangeTracker implements RangeTracker<Long> { @Override public boolean trySplitAtPosition(Long splitOffset) { return trySplitAtPosition(splitOffset.longValue()); } OffsetRangeTracker(long startOffset, long stopOffset); private  OffsetRangeTracker(); synchronized boolean isStarted(); synchronized boolean isDone(); @Override synchronized Long getStartPosition(); @Override synchronized Long getStopPosition(); @Override boolean tryReturnRecordAt(boolean isAtSplitPoint, Long recordStart); synchronized boolean tryReturnRecordAt(boolean isAtSplitPoint, long recordStart); @Override boolean trySplitAtPosition(Long splitOffset); synchronized boolean trySplitAtPosition(long splitOffset); synchronized long getPositionForFractionConsumed(double fraction); @Override synchronized double getFractionConsumed(); synchronized long getSplitPointsProcessed(); synchronized boolean markDone(); @Override synchronized String toString(); static final long OFFSET_INFINITY; }
@Test public void testSplitAtOffsetFailsIfUnstarted() throws Exception { OffsetRangeTracker tracker = new OffsetRangeTracker(100, 200); assertFalse(tracker.trySplitAtPosition(150)); }