Data implements ValueObject, Serializable { @Override public final String toString() { return new ToStringBuilder(this).append("type", type) .append("mimeType", mimeType).append("content", content) .toString(); } protected  Data();  Data(@NotNull final String type,
            @NotNull final EnhancedMimeType mimeType,
            @NotNull final String content); @NotNull final String getType(); @NotNull final EnhancedMimeType getMimeType(); @NotNull final String getContent(); final boolean isXml(); final boolean isJson(); final boolean isText(); @SuppressWarnings("unchecked") final T unmarshalContent(final JAXBContext ctx); @Override final String toString(); static Data valueOf(final String type, final Object obj);  }
@Test public final void testMarshalUnmarshalXML() throws Exception { final Data original = testee; final String xml = marshalToStr(original, createXmlAdapter(), Data.class); final String expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<data type=\"MyEvent\" mime-type=\"application/xml; version=1; encoding=utf-8\">" + " <![CDATA[" + CONTENT + "]]>" + "</data>"; final Diff documentDiff = DiffBuilder.compare(expectedXml).withTest(xml) .ignoreWhitespace().build(); assertThat(documentDiff.hasDifferences()) .describedAs(documentDiff.toString()).isFalse(); }