ProjectFileNode (ProjectFileNode parent) { List<ProjectFileNode> children = model.getChildren(parent); ProjectFileNode child = children.size() != 1 ? null : children.get(0); return child != null && child.getVirtualFile().isDirectory() ? child : null; }