TeamStates { @JsonValue public ImmutableMap<Integer, TeamState> getTeamNbToState() { return teamNbToState; } TeamStates(); @JsonCreator private  TeamStates(ImmutableMap<Integer, TeamState> teamNbToState); Optional<TeamState> getStateForTeam(int teamNb); TeamStates setStateForTeam(int teamNb, TeamState state); int getNbLapsForTeam(int teamNb); @JsonValue ImmutableMap<Integer, TeamState> getTeamNbToState();  }
@Test public void testJsonDeserialize_OneMember() throws Exception { TeamStates teamStates = Serialization.getJsonMapper().readValue("{\"0\":{\"tagFragmentCount\":0}}", TeamStates.class); assertThat(teamStates.getTeamNbToState(), hasKey(0)); }
@Test public void testJsonDeserialize_DefaultObject() throws Exception { TeamStates teamStates = Serialization.getJsonMapper().readValue("{}", TeamStates.class); assertThat(teamStates.getTeamNbToState(), equalTo(Collections.EMPTY_MAP)); }