boolean (PsiJavaModule source, PsiJavaModule destination) { Collection<PsiJavaModule> nodes = myGraph.getNodes(); if (nodes.contains(destination) && nodes.contains(source)) { Iterator<PsiJavaModule> directReaders = myGraph.getOut(destination); while (directReaders.hasNext()) { PsiJavaModule next = directReaders.next(); if (source.equals(next) || myTransitiveEdges.contains(key(destination, next)) && reads(source, next)) { return true; } } } return false; }