private static ArrayList<TreeNode> childrenToArray(DefaultMutableTreeNode node) {
      ArrayList<TreeNode> arrayList = new ArrayList<>();
      for (int i = 0; i < node.getChildCount(); i++) {
        arrayList.add(node.getChildAt(i));
      }
      return arrayList;
    }
private static ArrayList<TreeNode> childrenToArray(DefaultMutableTreeNode node)