TeamTagMap { public Optional<Integer> tagToTeam(String tag) throws DecodingException { return tagToTeam(new TagId(tag)); } 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();  }
@Test public void testLoadFromJackson() throws Exception { String myJson = "{\"2\":[\"ABCDEF\"],\"4\":[\"FEDCEB\"]}"; TeamTagMap result = Serialization.getJsonMapper().readValue(myJson, TeamTagMap.class); assertThat(result.tagToTeam(new TagId("ABCDEF")), equalTo(Optional.of(2))); assertThat(result.tagToTeam(new TagId("FEDCEB")), equalTo(Optional.of(4))); }