private static boolean isValid(@NotNull AbstractTreeStructure structure, Object element) {
    if (element == null) return false;
    if (element instanceof AbstractTreeNode<?> node) {
      if (null == node.getValue()) {
        return false;
      }
    }
    if (element instanceof ValidateableNode node) {
      if (!node.isValid()) return false;
    }
    return structure.isValid(element);
  }
private static boolean isValid(@NotNull AbstractTreeStructure structure, Object element)