@Override
  public ContinuousEnumerationResult planSplits(IcebergEnumeratorPosition lastPosition) {
    table.refresh();
    if (lastPosition != null) {
      return discoverIncrementalSplits(lastPosition);
    } else {
      return discoverInitialSplits();
    }
  }
@Test
  public void testTableScanThenIncrementalWithEmptyTable() throws Exception {
    ScanContext scanContext =
        ScanContext.builder()
            .startingStrategy(StreamingStartingStrategy.TABLE_SCAN_THEN_INCREMENTAL)
            .build();
    ContinuousSplitPlannerImpl splitPlanner =
        new ContinuousSplitPlannerImpl(TABLE_RESOURCE.tableLoader().clone(), scanContext, null);

    ContinuousEnumerationResult emptyTableInitialDiscoveryResult = splitPlanner.planSplits(null);
    assertThat(emptyTableInitialDiscoveryResult.splits()).isEmpty();
    assertThat(emptyTableInitialDiscoveryResult.fromPosition()).isNull();
    assertThat(emptyTableInitialDiscoveryResult.toPosition().isEmpty()).isTrue();
    assertThat(emptyTableInitialDiscoveryResult.toPosition().snapshotTimestampMs()).isNull();

    ContinuousEnumerationResult emptyTableSecondDiscoveryResult =
        splitPlanner.planSplits(emptyTableInitialDiscoveryResult.toPosition());
    assertThat(emptyTableSecondDiscoveryResult.splits()).isEmpty();
    assertThat(emptyTableSecondDiscoveryResult.fromPosition().isEmpty()).isTrue();
    assertThat(emptyTableSecondDiscoveryResult.fromPosition().snapshotTimestampMs()).isNull();
    assertThat(emptyTableSecondDiscoveryResult.toPosition().isEmpty()).isTrue();
    assertThat(emptyTableSecondDiscoveryResult.toPosition().snapshotTimestampMs()).isNull();

    // next 3 snapshots
    IcebergEnumeratorPosition lastPosition = emptyTableSecondDiscoveryResult.toPosition();
    for (int i = 0; i < 3; ++i) {
      lastPosition = verifyOneCycle(splitPlanner, lastPosition).lastPosition;
    }
  }