PsiExpression (PsiExpression expression, Set<Object> existingCaseValues) { final EqualityCheck check = EqualityCheck.from(expression); if (check == null) { return null; } final PsiExpression left = check.getLeft(); final PsiExpression right = check.getRight(); final Object leftValue = ExpressionUtils.computeConstantExpression(left); if (leftValue!= null) { if (existingCaseValues == null || existingCaseValues.add(leftValue)) { return right; } } final Object rightValue = ExpressionUtils.computeConstantExpression(right); if (rightValue != null) { if (existingCaseValues == null || existingCaseValues.add(rightValue)) { return left; } } return null; }