### Question:
XMLMapHandler { @Nullable @ReturnsMutableCopy public static ICommonsMap <String, String> readMap (@Nonnull final IHasInputStream aISP) { ValueEnforcer.notNull (aISP, "InputStreamProvider"); return readMap (aISP.getInputStream ()); } private  XMLMapHandler(); @Nullable @ReturnsMutableCopy static ICommonsMap <String, String> readMap(@Nonnull final IHasInputStream aISP); @Nonnull static ESuccess readMap(@Nonnull final IHasInputStream aISP, @Nonnull final Map <String, String> aTargetMap); @Nullable @ReturnsMutableCopy static ICommonsMap <String, String> readMap(@Nonnull @WillClose final InputStream aIS); @Nonnull static ESuccess readMap(@Nonnull @WillClose final InputStream aIS, @Nonnull final Map <String, String> aTargetMap); @Nonnull static ESuccess readMap(@Nonnull final IMicroElement aParentElement, @Nonnull final Map <String, String> aTargetMap); @Nonnull static IMicroDocument createMapDocument(@Nonnull final Map <String, String> aMap); @Nonnull static ESuccess writeMap(@Nonnull final Map <String, String> aMap, @Nonnull final IHasOutputStream aOSP); @Nonnull static ESuccess writeMap(@Nonnull final Map <String, String> aMap, @Nonnull @WillClose final OutputStream aOS); static final String ELEMENT_MAPPING; static final String ELEMENT_MAP; static final String ATTR_KEY; static final String ATTR_VALUE; }### Answer:
@Test public void testReadInvalid () { final ICommonsMap <String, String> aMap = new CommonsHashMap <> (); final IReadableResource aRes = new ClassPathResource ("xml/buildinfo.xml"); try { XMLMapHandler.readMap ((IHasInputStream) null); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.readMap ((IHasInputStream) null, aMap); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.readMap ((InputStream) null); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.readMap ((InputStream) null, aMap); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.readMap (aRes, null); fail (); } catch (final NullPointerException ex) {} String sXML = "<root><map value='b'/><map key='a'/><map key='c' value='d' /><map key='c' value='e' /></root>"; final Map <String, String> aMap2 = XMLMapHandler.readMap (new StringInputStreamProvider (sXML, StandardCharsets.ISO_8859_1)); assertNotNull (aMap2); assertEquals (1, aMap2.size ()); assertEquals ("e", aMap2.get ("c")); sXML = "<?xml version=\"1.0\"?>"; assertNull (XMLMapHandler.readMap (new StringInputStreamProvider (sXML, StandardCharsets.ISO_8859_1))); }