code: public static void lazyAppend(Element parent, Element child) {
          if (!parent.contains(child)) {
              parent.appendChild(child);
          }
      }
docs: Appends the specified element to the parent element if not already present. If parent already contains child,
  this method does nothing.