### Question:
ResourceName implements Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("name", name); return theResult; } ResourceName(String aName); String get(); String getOnlyFileName(); @Override boolean equals(Object o); @Override int hashCode(); @Override Map<String, Object> serialize(); static ResourceName deserialize(Map<String, Object> aSerializedData); final String name; }### Answer:
@Test public void testSerialize() throws Exception { ResourceName theResourceName1 = new ResourceName(null); Map<String, Object> theData = theResourceName1.serialize(); assertEquals(1, theData.size()); assertEquals(null, theData.get("name")); ResourceName theResourceName2 = new ResourceName("test"); Map<String, Object> theData2 = theResourceName2.serialize(); assertEquals(1, theData2.size()); assertEquals("test", theData2.get("name")); }