protected function getConflicts($entitiesByModule)
    {
        $modules = array_keys($entitiesByModule);
        $allConflicts = array();
        // bubble-compare each group of modules
        for ($i = 0; $i < count($modules) - 1; $i++) {
            $left = array_keys($entitiesByModule[$modules[$i]]);
            for ($j = $i+1; $j < count($modules); $j++) {
                $right = array_keys($entitiesByModule[$modules[$j]]);
                $conflicts = array_intersect($left, $right);
                $allConflicts = array_merge($allConflicts, $conflicts);
            }
        }
        return array_unique($allConflicts);
    }