private static boolean isComparisonWithPrimitives(@Nullable PsiExpression psiExpression, @NotNull PsiExpression switchExpression,
                                                    @NotNull Set<Object> existingCaseValues) {
    if (!(psiExpression instanceof PsiBinaryExpression psiBinaryExpression)) {
      return false;
    }
    if (!(TypeConversionUtil.isPrimitiveAndNotNullOrWrapper(switchExpression.getType()))) {
      return false;
    }
    if (psiBinaryExpression.getOperationTokenType() != JavaTokenType.EQEQ) {
      return false;
    }
    final PsiExpression left = psiBinaryExpression.getLOperand();
    final PsiExpression right = psiBinaryExpression.getROperand();
    if (right == null) return false;
    if (EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(switchExpression, right) &&
        primitiveValueCanBeUsedForComparisonInCase(left, right, existingCaseValues)) {
      return true;
    }
    else {
      if (EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(switchExpression, left) &&
          primitiveValueCanBeUsedForComparisonInCase(right, left, existingCaseValues)) {
        return true;
      }
    }
    return false;
  }
private static boolean isComparisonWithPrimitives(@Nullable PsiExpression psiExpression, @NotNull PsiExpression switchExpression,
                                                    @NotNull Set<Object> existingCaseValues)