public synchronized long getSplitPointsConsumed() {
    if (position == null) {
      return 0;
    } else if (isDone()) {
      return splitPointsSeen;
    } else {
      // There is a current split point, and it has not finished processing.
      checkState(
          splitPointsSeen > 0,
          "A started rangeTracker should have seen > 0 split points (is %s)",
          splitPointsSeen);
      return splitPointsSeen - 1;
    }
  }
@Test
  public void testGetSplitPointsConsumed() {
    ByteKeyRangeTracker tracker = ByteKeyRangeTracker.of(INITIAL_RANGE);
    assertEquals(0, tracker.getSplitPointsConsumed());

    // Started, 0 split points consumed
    assertTrue(tracker.tryReturnRecordAt(true, INITIAL_START_KEY));
    assertEquals(0, tracker.getSplitPointsConsumed());

    // Processing new split point, 1 split point consumed
    assertTrue(tracker.tryReturnRecordAt(true, AFTER_START_KEY));
    assertEquals(1, tracker.getSplitPointsConsumed());

    // Processing new non-split point, 1 split point consumed
    assertTrue(tracker.tryReturnRecordAt(false, INITIAL_MIDDLE_KEY));
    assertEquals(1, tracker.getSplitPointsConsumed());

    // Processing new split point, 2 split points consumed
    assertTrue(tracker.tryReturnRecordAt(true, BEFORE_END_KEY));
    assertEquals(2, tracker.getSplitPointsConsumed());

    // Mark tracker as done, 3 split points consumed
    tracker.markDone();
    assertEquals(3, tracker.getSplitPointsConsumed());
  }