boolean (DetectedProjectRoot root, Map<File, DetectedRootData> rootData) { File directory = root.getDirectory().getParentFile(); while (directory != null) { final DetectedRootData data = rootData.get(directory); if (data != null) { for (DetectedProjectRoot parentRoot : data.getAllRoots()) { if (!parentRoot.canContainRoot(root)) { return true; } } } directory = directory.getParentFile(); } return false; }