@Test
public void testSerializeToJson_ComplexerObject() throws Exception {

    Snapshot snapshot = Snapshot.builder(Instant.EPOCH, null)
            .withStartTime(Instant.EPOCH)
            .withEndTime(Instant.EPOCH)
            .withTeamStates(new TeamStates()
                    .setStateForTeam(0, new TeamState().addTagSeenEvent(
                            new Snapshot(Instant.EPOCH),
                            new TagSeenEvent(Instant.EPOCH, new TagId("ABCD"), 0, 0L))
                            .addTagSeenEvent(null, // TODO: It's not really clean that we're passing null here,
                                    //       but it should work fine nonetheless
                                    new TagSeenEvent(Instant.EPOCH.plus(1000, ChronoUnit.SECONDS),
                                            new TagId("ABCD"), 0, 1L))))
            .withTeamTagMap(new TeamTagMap()
                    .addTagToTeam("ABCD", 0))
            .withStatusMessage("foo").build();
    MatcherAssert.assertThat(objectMapper.writeValueAsString(snapshot),
            SameJSONAs.sameJSONAs("{\"snapshotTime\":0,statusMessage:foo,\"startTime\":0,\"endTime\":0,\"teamTagMap\":{\"0\":[\"ABCD\"]}," +
                    "\"teamStates\":{\"0\":{\"lastTagSeenEvent\":{\"type\":\"TagSeen\",\"time\":1000," +
                    "\"tag\":\"ABCD\",\"readerId\":0}, \"tagFragmentCount\":3}}}").allowingExtraUnexpectedFields());
}