boolean (Module sourceModule, Module targetModule) { if (targetModule == null || sourceModule == null || targetModule.equals(sourceModule)) { return false; } ModulesSet sourceGroup = myModuleNameToModulesSet.get(sourceModule.getName()); ModulesSet targetGroup = myModuleNameToModulesSet.get(targetModule.getName()); return sourceGroup == null || sourceGroup != targetGroup; }