@Override
  public TableScan appendsBetween(long fromSnapshotId, long toSnapshotId) {
    validateSnapshotIdsRefinement(fromSnapshotId, toSnapshotId);
    return new IncrementalDataTableScan(
        table(),
        schema(),
        context().fromSnapshotIdExclusive(fromSnapshotId).toSnapshotId(toSnapshotId));
  }
@TestTemplate
  public void testInvalidScans() {
    add(table.newAppend(), files("A"));
    assertThatThrownBy(() -> appendsBetweenScan(1, 1))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("from and to snapshot ids cannot be the same");

    add(table.newAppend(), files("B"));
    add(table.newAppend(), files("C"));
    add(table.newAppend(), files("D"));
    add(table.newAppend(), files("E"));
    assertThatThrownBy(() -> table.newScan().appendsBetween(2, 5).appendsBetween(1, 4))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("from snapshot id 1 not in existing snapshot ids range (2, 4]");
    assertThatThrownBy(() -> table.newScan().appendsBetween(1, 2).appendsBetween(1, 3))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("to snapshot id 3 not in existing snapshot ids range (1, 2]");
  }