public static Snapshot oldestAncestor(Table table) {
    Snapshot lastSnapshot = null;
    for (Snapshot snapshot : currentAncestors(table)) {
      lastSnapshot = snapshot;
    }

    return lastSnapshot;
  }
@Test
  public void oldestAncestor() {
    Snapshot snapshot = SnapshotUtil.oldestAncestor(table);
    assertThat(snapshot.snapshotId()).isEqualTo(snapshotBaseId);

    snapshot = SnapshotUtil.oldestAncestorOf(table, snapshotMain2Id);
    assertThat(snapshot.snapshotId()).isEqualTo(snapshotBaseId);

    snapshot = SnapshotUtil.oldestAncestorAfter(table, snapshotBaseTimestamp + 1);
    assertThat(snapshot.snapshotId()).isEqualTo(snapshotMain1Id);
  }