### Question:
XMLMapHandler { @Nonnull public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull final IHasOutputStream aOSP) { ValueEnforcer.notNull (aOSP, "OutputStreamProvider"); return writeMap (aMap, aOSP.getOutputStream (EAppend.DEFAULT)); } 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 testWriteInvalid () { final ICommonsMap <String, String> aMap = new CommonsHashMap <> (); try { XMLMapHandler.writeMap (aMap, (IHasOutputStream) null); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.writeMap (null, new ByteArrayOutputStreamProvider ()); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.writeMap (aMap, (OutputStream) null); fail (); } catch (final NullPointerException ex) {} try { XMLMapHandler.writeMap (null, new NonBlockingByteArrayOutputStream ()); fail (); } catch (final NullPointerException ex) {} }