XmlGenericMapAdapter extends XmlAdapter<MapType, Map<String, String>> { @Override public Map<String, String> unmarshal(MapType v) throws Exception { HashMap<String, String> map = new HashMap<String, String>(); if (v != null) { for (MapEntryType mapEntryType : v.getEntry()) { map.put(mapEntryType.getKey(), mapEntryType.getValue()); } } return map; }  @Override Map<String, String> unmarshal(MapType v); @Override MapType marshal(Map<String, String> v);  }
@Test public void testUnmarshal_1() throws Exception { XmlGenericMapAdapter fixture = new XmlGenericMapAdapter(); MapType v = new MapType(); v.setEntry(new LinkedList()); Map<String, String> result = fixture.unmarshal(v); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testUnmarshal_2() throws Exception { XmlGenericMapAdapter fixture = new XmlGenericMapAdapter(); MapType v = new MapType(); v.setEntry(new LinkedList()); Map<String, String> result = fixture.unmarshal(v); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testUnmarshal_3() throws Exception { XmlGenericMapAdapter fixture = new XmlGenericMapAdapter(); MapType v = null; Map<String, String> result = fixture.unmarshal(v); assertNotNull(result); assertEquals(0, result.size()); }