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