private static boolean canBeCaseLabel(@Nullable PsiExpression expression,
                                        @NotNull LanguageLevel languageLevel,
                                        @Nullable Set<Object> existingCaseValues) {
    if (expression == null) {
      return false;
    }
    if (JavaFeature.ENUMS.isSufficient(languageLevel) && expression instanceof PsiReferenceExpression ref) {
      final PsiElement referent = ref.resolve();
      if (referent instanceof PsiEnumConstant) {
        return existingCaseValues == null || existingCaseValues.add(referent);
      }
    }
    final PsiType type = expression.getType();
    if ((!JavaFeature.STRING_SWITCH.isSufficient(languageLevel) || !TypeUtils.isJavaLangString(type)) &&
        !PsiTypes.intType().equals(type) &&
        !PsiTypes.shortType().equals(type) &&
        !PsiTypes.byteType().equals(type) &&
        !PsiTypes.charType().equals(type)) {
      return false;
    }
    final Object value = ExpressionUtils.computeConstantExpression(expression);
    if (value == null) {
      return false;
    }
    return existingCaseValues == null || existingCaseValues.add(value);
  }
private static boolean canBeCaseLabel(@Nullable PsiExpression expression,
                                        @NotNull LanguageLevel languageLevel,
                                        @Nullable Set<Object> existingCaseValues)