MetadataSerializer { public MetadataElement fromXml(String xml) { if (StringUtils.isNullOrEmpty(xml)) { return null; } return (MetadataElement) xStream.fromXML(xml); } MetadataSerializer(); String toXml(MetadataElement metadataElement); MetadataElement fromXml(String xml);  }
@Test public void testFromXml_Null() { final MetadataElement metadataElement = serializer.fromXml(null); assertNull(metadataElement); }
@Test public void testFromXml_EmptyString() { final MetadataElement metadataElement = serializer.fromXml(""); assertNull(metadataElement); }