record (@NotNull PsiExpression expression, boolean isEqual) { @Nullable static Negated create(@Nullable PsiExpression maybeNegatedExpression) { boolean equal = true; PsiExpression expression = PsiUtil.skipParenthesizedExprDown(maybeNegatedExpression); if (expression instanceof PsiPrefixExpression prefixExpression) { if (JavaTokenType.EXCL.equals(prefixExpression.getOperationTokenType())) { equal = false; expression = PsiUtil.skipParenthesizedExprDown(prefixExpression.getOperand()); } } return expression != null ? new Negated(expression, equal) : null; } }