### Question:
DefaultMentionsNotificationsObjectMapper implements MentionsNotificationsObjectMapper, Initializable { @Override public Optional<MentionEventParams> unserialize(String data) { try { MentionEventParams mentionEventParams = this.objectMapper.readValue(new StringReader(data), MentionEventParams.class); return Optional.of(mentionEventParams); } catch (IOException e) { this.logger.warn("Failed to parse [{}]. Cause [{}].", data, getRootCauseMessage(e)); return Optional.empty(); } }  @Override Optional<MentionEventParams> unserialize(String data); @Override Optional<String> serialize(MentionEventParams params); @Override void initialize();  }### Answer:
@Test void unserializeMinimalObject() { Optional<MentionEventParams> actual = this.objectMapper.unserialize("{}"); assertTrue(actual.isPresent()); assertEquals(new MentionEventParams(), actual.get()); }
@Test void unserialize() { Optional<MentionEventParams> actual = this.objectMapper.unserialize( "{\"userReference\":\"xwiki:XWiki.User\"," + "\"documentReference\":\"xwiki:XWiki.Doc\"," + "\"location\":\"COMMENT\"," + "\"anchor\":\"myAnchor\"}"); assertTrue(actual.isPresent()); MentionEventParams expected = new MentionEventParams() .setDocumentReference("xwiki:XWiki.Doc") .setUserReference("xwiki:XWiki.User") .setLocation(MentionLocation.COMMENT) .setAnchor("myAnchor"); assertEquals(expected, actual.get()); }