ElementHelper { public static void insertAfter(final Node newNode, final Node referenceNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); }  static void insertAfter(final Node newNode,
                                   final Node referenceNode); static void insertBefore(final Node newNode,
                                    final Node referenceNode); static void remove(final Node element);  }
@Test public void testInsertAfter() { final Node newNode = mock(Node.class); final Node referenceNode = mock(Node.class); final Node parentNode = mock(Node.class); final Node nextSibling = mock(Node.class); referenceNode.parentNode = parentNode; referenceNode.nextSibling = nextSibling; ElementHelper.insertAfter(newNode, referenceNode); verify(parentNode).insertBefore(newNode, nextSibling); }