### Question:
SyncService { Integer calculateNextSnapshotNr(Snapshot snapshot, TreeSet<Integer> availableCloneSources) { return availableCloneSources.higher(snapshot.nr); }  StreamState calculateStreamState(Stream stream, boolean isNew); List<SendFileSpec> determineSendFiles(Stream sourceStream,
            StreamState stateOfTarget);  }### Answer:
@Test public void testCalculateNextSnapshotNr() throws Exception { Snapshot snapshot = new Snapshot(3, null, null); TreeSet<Integer> available = new TreeSet<>(); available.add(2); assertThat(service.calculateNextSnapshotNr(snapshot, available), is(nullValue())); available.add(3); assertThat(service.calculateNextSnapshotNr(snapshot, available), is(nullValue())); available.add(4); assertThat(service.calculateNextSnapshotNr(snapshot, available), is(4)); }