@Test public void should_track_serial_number() { assertThat(subject.getCurrentVersion()).isEqualTo(SerialNumber.of(0)); subject.updateValues(Arrays.asList(1, 2, 3)); assertThat(subject.getCurrentVersion()).isEqualTo(SerialNumber.of(1)); subject.updateValues(Arrays.asList(2, 3, 4)); assertThat(subject.getCurrentVersion()).isEqualTo(SerialNumber.of(2)); }
public boolean updateValues(Collection<T> newValues) { return updateValues(newValues.stream()); }
VersionedSet { public boolean updateValues(Collection<T> newValues) { return updateValues(newValues.stream()); } }
VersionedSet { public boolean updateValues(Collection<T> newValues) { return updateValues(newValues.stream()); } VersionedSet();  VersionedSet(SerialNumber initialVersion); }
VersionedSet { public boolean updateValues(Collection<T> newValues) { return updateValues(newValues.stream()); } VersionedSet();  VersionedSet(SerialNumber initialVersion); boolean updateValues(Collection<T> newValues); boolean updateValues(Stream<T> newValues); Set<SerialNumber> forgetDeltasBefore(SerialNumber version); Optional<Delta<T>> getDelta(SerialNumber version); int size(); }
VersionedSet { public boolean updateValues(Collection<T> newValues) { return updateValues(newValues.stream()); } VersionedSet();  VersionedSet(SerialNumber initialVersion); boolean updateValues(Collection<T> newValues); boolean updateValues(Stream<T> newValues); Set<SerialNumber> forgetDeltasBefore(SerialNumber version); Optional<Delta<T>> getDelta(SerialNumber version); int size();  }