SiblingInfo (@NotNull PsiClass inheritor, @NotNull PsiClass anInterface, @NotNull PsiMethod method) { for (PsiMethod superMethod : anInterface.findMethodsByName(method.getName(), true)) { PsiClass superInterface = superMethod.getContainingClass(); if (superInterface == null || myContainingClass.isInheritor(superInterface, true)) { // if containingClass implements the superInterface then it's not a sibling inheritance but a pretty boring the usual one continue; } if (isOverridden(inheritor, method, superMethod, superInterface)) { PsiElement navigationElement = superMethod.getNavigationElement(); if (!(navigationElement instanceof PsiMethod)) continue; // Kotlin return new SiblingInfo((PsiMethod)navigationElement, inheritor); } } return null; }