boolean (@NotNull PsiManager manager, JavaResolveResult @NotNull [] resolved, JavaResolveResult @NotNull [] resolvedAfter) { // returns true if there's at least one element from "resolved" which is the same as one of "resolvedAfter" for (JavaResolveResult result : resolved) { if (!result.isAccessible()) continue; for (JavaResolveResult resultAfter : resolvedAfter) { if (resultAfter.isAccessible() && manager.areElementsEquivalent(result.getElement(), resultAfter.getElement())) { return true; } } } return false; }