code: public static void lazyInsertAfter(Element newElement, Element after) {
          if (!after.parentNode.contains(newElement)) {
              after.parentNode.insertBefore(newElement, after.nextSibling);
          }
      }
docs: Inserts the specified element into the parent of the after element if not already present. If parent already
  contains child, this method does nothing.