### Question:
MicroHelper { @Nonnull public static IMicroNode append (@Nonnull final IMicroNode aSrcNode, @Nullable final Object aChild) { ValueEnforcer.notNull (aSrcNode, "SrcNode"); if (aChild != null) if (aChild instanceof IMicroNode) { aSrcNode.appendChild ((IMicroNode) aChild); } else if (aChild instanceof String) { aSrcNode.appendText ((String) aChild); } else if (aChild instanceof Iterable <?>) { for (final Object aSubChild : (Iterable <?>) aChild) append (aSrcNode, aSubChild); } else if (ArrayHelper.isArray (aChild)) { for (final Object aSubChild : (Object []) aChild) append (aSrcNode, aSubChild); } else { throw new IllegalArgumentException ("Passed object cannot be appended to an IMicroNode (type=" + aChild.getClass ().getName () + "."); } return aSrcNode; } private  MicroHelper(); @Nonnull static IMicroNode append(@Nonnull final IMicroNode aSrcNode, @Nullable final Object aChild); @Nonnull @SuppressFBWarnings ("IL_INFINITE_LOOP") static String getPath(@Nullable final IMicroNode aNode, @Nonnull final String sSep); @Nullable static String getDocumentRootElementTagName(@Nullable final IMicroDocument aDoc); @Nonnull static IMicroNode convertToMicroNode(@Nonnull final Node aNode); @Nullable static String getChildTextContent(@Nonnull final IMicroElement eParentElement, @Nonnull final String sChildElementName); @Nullable static String getChildTextContentTrimmed(@Nonnull final IMicroElement eParentElement, @Nonnull final String sChildElementName); @Nullable static DSTTYPE getChildTextContentWithConversion(@Nonnull final IMicroElement eParentElement,
                                                                     @Nonnull final String sChildElementName,
                                                                     @Nonnull final Class <DSTTYPE> aDstClass); @Nullable static String getChildTextContent(@Nonnull final IMicroElement eParentElement,
                                            @Nonnull final String sNamespaceURI,
                                            @Nonnull final String sChildElementName); @Nullable static String getChildTextContentTrimmed(@Nonnull final IMicroElement eParentElement,
                                                   @Nonnull final String sNamespaceURI,
                                                   @Nonnull final String sChildElementName); @Nullable static DSTTYPE getChildTextContentWithConversion(@Nonnull final IMicroElement eParentElement,
                                                                     @Nonnull final String sNamespaceURI,
                                                                     @Nonnull final String sChildElementName,
                                                                     @Nonnull final Class <DSTTYPE> aDstClass); @Nonnull @ReturnsMutableCopy static IMicroContainer getAllChildrenAsContainer(@Nonnull final IMicroNode aParent); @Nonnull @ReturnsMutableCopy static IMicroContainer getAllOriginalChildrenAsContainer(@Nonnull final IMicroNode aParent);  }### Answer:
@Test public void testAppend () { final IMicroDocument aDoc = new MicroDocument (); final IMicroElement eRoot = aDoc.appendElement ("root"); MicroHelper.append (eRoot, "Any text"); MicroHelper.append (eRoot, new MicroElement ("child")); MicroHelper.append (eRoot, CollectionHelper.newList ("t1", "t2")); MicroHelper.append (eRoot, ArrayHelper.newArray ("t1", "t2")); try { MicroHelper.append (null, "any"); fail (); } catch (final NullPointerException ex) {} try { MicroHelper.append (eRoot, new MockHasDisplayName (5)); fail (); } catch (final IllegalArgumentException ex) {} }