Snapshot { public TeamTagMap getTeamTagMap() { return teamTagMap; } @SuppressWarnings("unused") private  Snapshot();  Snapshot(Instant time); Optional<Long> getId(); Optional<Long> getEventId(); Instant getSnapshotTime(); TeamTagMap getTeamTagMap(); Instant getStartTime(); Instant getEndTime(); TeamStates getTeamStates(); TeamStates getPublicTeamStates(); String getStatusMessage(); Status getStatus(); int getUpdateFrequency(); static Builder builder(Instant time, Snapshot other); static Optional<Snapshot> loadForEvent(Connection connection, Event event); static Optional<Snapshot> loadLatest(Connection connection); static Optional<Snapshot> loadBefore(Connection connection, Instant time); void save(Connection connection); static void deleteAfter(Connection connection, Snapshot snapshot);  }
@Test public void testAddTagEvent() throws Exception { Snapshot snapshot = new Snapshot(Instant.EPOCH); AddTagEvent addTagEvent = new AddTagEvent(Instant.EPOCH.plus(1, ChronoUnit.SECONDS), new TagId("ABCD"), 0); snapshot = addTagEvent.doApply(snapshot); MatcherAssert.assertThat(snapshot.getTeamTagMap().tagToTeam("ABCD").get(), Matchers.equalTo(0)); }