List<Module> (TreeNode[] sourceNodes) { final List<Module> modules = new ArrayList<>(); for (TreeNode sourceNode : sourceNodes) { if (sourceNode instanceof DefaultMutableTreeNode) { final Object userObject = AbstractProjectViewPane.extractValueFromNode(sourceNode); if (userObject instanceof Module) { modules.add((Module) userObject); } } } return modules; }