@Nullable
  public static PsiInstanceOfExpression findPatternCandidate(@NotNull PsiTypeCastExpression cast, @Nullable PsiVariable variable) {
    if (isUncheckedCast(cast)) return null;
    return findCorrespondingInstanceOf(cast, variable);
  }
@Nullable
  public static PsiInstanceOfExpression findPatternCandidate(@NotNull PsiTypeCastExpression cast, @Nullable PsiVariable variable)