@Test public void testWriteToJson() throws Exception { TeamTagMap ttm = new TeamTagMap(); ttm = ttm.addTagToTeam("abcd", 4); ttm = ttm.addTagToTeam("deff", 5); ttm = ttm.addTagToTeam("adcb", 4); String result = Serialization.getJsonMapper().writeValueAsString(ttm); assertThat(result, equalTo("{\"4\":[\"abcd\",\"adcb\"],\"5\":[\"deff\"]}")); }
public TeamTagMap addTagToTeam(String tag, int team) throws DecodingException { return addTagToTeam(new TagId(tag), team); }
TeamTagMap { public TeamTagMap addTagToTeam(String tag, int team) throws DecodingException { return addTagToTeam(new TagId(tag), team); } }
TeamTagMap { public TeamTagMap addTagToTeam(String tag, int team) throws DecodingException { return addTagToTeam(new TagId(tag), team); } TeamTagMap(); private  TeamTagMap(ImmutableMap<TagId,Integer> tagToTeam); }
TeamTagMap { public TeamTagMap addTagToTeam(String tag, int team) throws DecodingException { return addTagToTeam(new TagId(tag), team); } TeamTagMap(); private  TeamTagMap(ImmutableMap<TagId,Integer> tagToTeam); TeamTagMap addTagToTeam(String tag, int team); TeamTagMap addTagToTeam(TagId tag, int team); TeamTagMap removeTag(String tag); TeamTagMap removeTag(TagId tag); Optional<Integer> tagToTeam(String tag); Optional<Integer> tagToTeam(TagId tag); Map<TagId, Integer> getTagToTeam(); }
TeamTagMap { public TeamTagMap addTagToTeam(String tag, int team) throws DecodingException { return addTagToTeam(new TagId(tag), team); } TeamTagMap(); private  TeamTagMap(ImmutableMap<TagId,Integer> tagToTeam); TeamTagMap addTagToTeam(String tag, int team); TeamTagMap addTagToTeam(TagId tag, int team); TeamTagMap removeTag(String tag); TeamTagMap removeTag(TagId tag); Optional<Integer> tagToTeam(String tag); Optional<Integer> tagToTeam(TagId tag); Map<TagId, Integer> getTagToTeam();  }