final Map<Integer, MetadataSourceInfo> allSourceInfo = _metadataRepository.findAllSourceInfo(MetadataSpecs.hasMetadataIdIn(metadataIds));
for (Map.Entry<String, Element> entry : mdIdToInfoMap.entrySet()) {
Element infoEl = entry.getValue();
final Integer mdId = Integer.valueOf(entry.getKey());
MetadataSourceInfo sourceInfo = allSourceInfo.get(mdId);
Set<ReservedOperation> operations = operationsPerMetadata.get(mdId);
if (operations == null) {
operations = Collections.emptySet();
}