boolean (ConditionType conditionType, @Nullable PsiExpression expression) { PsiUnaryExpression updateUnary = tryCast(expression, PsiUnaryExpression.class); if (updateUnary != null) { IElementType tokenType = updateUnary.getOperationTokenType(); if (conditionType == ConditionType.VarGreater) { return tokenType == JavaTokenType.PLUSPLUS; } else { return tokenType == JavaTokenType.MINUSMINUS; } } PsiAssignmentExpression assignment = tryCast(expression, PsiAssignmentExpression.class); if (assignment != null) { Object rightPart = ExpressionUtils.computeConstantExpression(assignment.getRExpression()); Number number = tryCast(rightPart, Number.class); if (number == null) return false; boolean negative = number.longValue() < 0; IElementType op = assignment.getOperationTokenType(); if (conditionType == ConditionType.VarGreater) { return (op == JavaTokenType.PLUSEQ && !negative) || (op == JavaTokenType.MINUSEQ && negative); } else { return (op == JavaTokenType.MINUSEQ && !negative) || (op == JavaTokenType.PLUSEQ && negative); } } return false; }