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