use of org.apache.commons.collections4.multimap.HashSetValuedHashMap in project methods-distance by sevntu-checkstyle.
the class MethodOrder method getMethodInvocationsNesting.
private static MultiValuedMap<MethodInvocation, MethodInvocation> getMethodInvocationsNesting(Map<ResolvedCall, MethodInvocation> callToInvocation) {
final SetValuedMap<MethodInvocation, MethodInvocation> nestedInside = new HashSetValuedHashMap<>();
callToInvocation.entrySet().stream().forEach(entry -> {
final ResolvedCall resolvedCall = entry.getKey();
final MethodInvocation methodInvocation = entry.getValue();
callToInvocation.keySet().stream().filter(rc -> !rc.equals(resolvedCall)).filter(resolvedCall::isNestedInside).forEach(rc -> nestedInside.put(methodInvocation, callToInvocation.get(rc)));
});
return nestedInside;
}
Aggregations