Collection<MavenProject> (MavenProject project) { if (project.isNew()) return List.of(); return withReadLock(() -> { List<MavenProject> result = null; MavenId id = project.getMavenId(); for (MavenProject each : myVirtualFileToProjectMapping.values()) { if (each == project) continue; if (id.equals(each.getParentId())) { if (result == null) result = new ArrayList<>(); result.add(each); } } return result == null ? List.of() : result; }); }