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