private static boolean needsSupers(final PsiElement element, final MatchingHandler handler) {
    if (element.getParent() instanceof PsiClass && handler instanceof SubstitutionHandler handler2) {
      return handler2.isStrictSubtype() || handler2.isSubtype();
    }
    return false;
  }
private static boolean needsSupers(final PsiElement element, final MatchingHandler handler)