void (Map<String, TargetTypeBuildScope> scopeById, List<TargetTypeBuildScope> scopes) { for (TargetTypeBuildScope scope : scopes) { String id = scope.getTypeId(); TargetTypeBuildScope old = scopeById.get(id); if (old == null) { scopeById.put(id, scope); } else { scopeById.put(id, mergeScope(old, scope)); } } }