XstreamRecordMarshaller implements RecordMarshaller<P, String> { @Override public XmlRecord processRecord(final Record<P> record) { return new XmlRecord(record.getHeader(), xStream.toXML(record.getPayload())); } XstreamRecordMarshaller();  XstreamRecordMarshaller(final String elementName, final Class<?> type);  XstreamRecordMarshaller(final XStream xStream); @Override XmlRecord processRecord(final Record<P> record);  }
@Test public void marshal() { String expected = "<person><id>1</id><firstName>foo</firstName><lastName>bar</lastName><married>false</married></person>"; XmlRecord actual = xstreamRecordMarshaller.processRecord(record); assertThat(actual.getHeader()).isEqualTo(header); assertThat(actual.getPayload()).isXmlEqualTo(expected); }