void (PsiClass intf, HashSet<T> dependencies, HashMap<T, HashSet<T>> membersToInterfacesMap) { HashSet<T> interfaceMethods = myMethodsFromInterfaces.get(intf); if(interfaceMethods == null) { interfaceMethods = new HashSet<>(); buildInterfaceMethods(interfaceMethods, intf); myMethodsFromInterfaces.put(intf, interfaceMethods); } for (T method : interfaceMethods) { HashSet<T> interfaces = membersToInterfacesMap.get(method); if (interfaces == null) { interfaces = new HashSet<>(); membersToInterfacesMap.put(method, interfaces); } interfaces.add((T)intf); } dependencies.addAll(interfaceMethods); }