MetadataSerializer { public String toXml(MetadataElement metadataElement) { if (metadataElement == null) { return ""; } return xStream.toXML(metadataElement); } MetadataSerializer(); String toXml(MetadataElement metadataElement); MetadataElement fromXml(String xml);  }
@Test public void testToXml_Null() { final String xml = serializer.toXml(null); assertEquals("", xml); }