code: public static boolean parentContainsOnlyLeaves(ParentNode parentNode) {
          for (Node child : parentNode.children()) {
              if (!isLeaf(child)) return false;
          }
          return true;
      }
docs: Determines if parent node has children that are all leaves