private static boolean leaveOverrideAnnotation(PsiClass aClass, PsiSubstitutor substitutor, PsiMethod method) {
    final PsiMethod methodBySignature = MethodSignatureUtil.findMethodBySignature(aClass, method.getSignature(substitutor), false);
    if (methodBySignature == null) return false;
    final PsiMethod[] superMethods = methodBySignature.findDeepestSuperMethods();
    if (superMethods.length == 0) return false;
    if (!PsiUtil.isAvailable(JavaFeature.OVERRIDE_INTERFACE, methodBySignature)) {
      for (PsiMethod psiMethod : superMethods) {
        final PsiClass psiClass = psiMethod.getContainingClass();
        if (psiClass != null && psiClass.isInterface()) {
          return false;
        }
      }
    }
    return true;
  }
private static boolean leaveOverrideAnnotation(PsiClass aClass, PsiSubstitutor substitutor, PsiMethod method)