EventIdConverter extends XmlAdapter<String, EventId> { @Override @Nullable public final EventId unmarshal(@Nullable final String value) throws Exception { if (value == null) { return null; } return new EventId(value); }  @Override @Nullable final EventId unmarshal(@Nullable final String value); @Override @Nullable final String marshal(@Nullable final EventId value);  }
@Test public final void testUnmarshalNull() throws Exception { assertThat(new EventIdConverter().unmarshal(null)).isNull(); }
@Test public final void testUnmarshal() throws Exception { final EventId eventId = new EventId(UUID); assertThat(new EventIdConverter().unmarshal(UUID)).isEqualTo(eventId); }