@VisibleForTesting
  Iterable<SnapshotContext> getSnapshots(Iterable<Snapshot> snapshots, SnapshotContext since) {
    List<SnapshotContext> result = Lists.newArrayList();

    boolean foundSince = Objects.isNull(since);
    for (Snapshot snapshot : snapshots) {
      if (!foundSince) {
        if (snapshot.snapshotId() == since.getSnapshotId()) {
          foundSince = true;
        }
      } else {
        result.add(toSnapshotContext(snapshot));
      }
    }

    return foundSince ? result : Collections.emptyList();
  }
@Test
  public void testGetSnapshotContextsReturnsAllSnapshotsWhenGivenSnapshotIsNull() {
    HiveIcebergStorageHandler storageHandler = new HiveIcebergStorageHandler();
    Iterable<SnapshotContext> result = storageHandler.getSnapshots(asList(appendSnapshot, deleteSnapshot), null);

    List<SnapshotContext> resultList = IterableUtils.toList(result);
    assertThat(resultList.size(), is(2));
    assertThat(resultList.get(0).getSnapshotId(), is(appendSnapshot.snapshotId()));
    assertThat(resultList.get(0).getOperation(), is(SnapshotContext.WriteOperationType.APPEND));
    assertThat(resultList.get(0).getAddedRowCount(), is(12L));
    assertThat(resultList.get(0).getDeletedRowCount(), is(0L));

    assertThat(resultList.get(1).getSnapshotId(), is(deleteSnapshot.snapshotId()));
    assertThat(resultList.get(1).getOperation(), is(SnapshotContext.WriteOperationType.DELETE));
    assertThat(resultList.get(1).getAddedRowCount(), is(0L));
    assertThat(resultList.get(1).getDeletedRowCount(), is(3L));
  }