void (@NotNull GrUnaryExpression expression) { final boolean postfix = expression.isPostfix(); final GroovyResolveResult resolveResult = expression.getReference().advancedResolve(); final PsiElement resolved = resolveResult.getElement(); final GrExpression operand = expression.getOperand(); IElementType opType = expression.getOperationTokenType(); if (resolved instanceof PsiMethod) { if (opType == GroovyTokenTypes.mINC || opType == GroovyTokenTypes.mDEC) { if (!postfix || expression.getParent() instanceof GrStatementOwner || expression.getParent() instanceof GrControlStatement) { if (generatePrefixIncDec((PsiMethod)resolved, operand, expression)) return; } } if (operand != null && shouldNotReplaceOperatorWithMethod(operand.getType(), null, expression.getOperationTokenType())) { writeSimpleUnary(operand, expression, this); } else { if (opType == GroovyTokenTypes.mLNOT) { builder.append('!'); } invokeMethodOn( ((PsiMethod)resolved), operand, GrExpression.EMPTY_ARRAY, GrNamedArgument.EMPTY_ARRAY, GrClosableBlock.EMPTY_ARRAY, resolveResult.getSubstitutor(), expression ); } } else if (operand != null) { if (postfix) { operand.accept(this); builder.append(expression.getOperationToken().getText()); } else { builder.append(expression.getOperationToken().getText()); operand.accept(this); } } }