Wrap a {@link CheckedUnaryOperator} in a {@link UnaryOperator}.
<p>
Example:
<code><pre>
Stream.of("a", "b", "c").map(Unchecked.unaryOperator(s -> {
if (s.length() > 10)
throw new Exception("Only short strings allowed");

return s;
}));
</pre></code>
969416
public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator) {
        return Unchecked.unaryOperator(operator, Unchecked.RETHROW_ALL);
    }
1166060
public final void unaryExpressionNotPlusMinus() throws RecognitionException {
		int unaryExpressionNotPlusMinus_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 125) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1204:5: ( '~' unaryExpression | '!' unaryExpression | castExpression | primary ( selector )* ( '++' | '--' )? )
			int alt159=4;
			switch ( input.LA(1) ) {
			case 126:
				{
				alt159=1;
				}
				break;
			case 29:
				{
				alt159=2;
				}
				break;
			case 36:
				{
				switch ( input.LA(2) ) {
				case 65:
				case 67:
				case 71:
				case 77:
				case 85:
				case 92:
				case 94:
				case 105:
					{
					int LA159_20 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case Identifier:
					{
					int LA159_21 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 40:
					{
					int LA159_22 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 44:
					{
					int LA159_23 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 41:
					{
					int LA159_24 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 45:
					{
					int LA159_25 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 126:
					{
					int LA159_26 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 29:
					{
					int LA159_27 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 36:
					{
					int LA159_28 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 53:
					{
					int LA159_29 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 111:
					{
					int LA159_30 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 108:
					{
					int LA159_31 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 80:
					{
					int LA159_32 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 79:
					{
					int LA159_33 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 70:
					{
					int LA159_34 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case DecimalLiteral:
				case HexLiteral:
				case OctalLiteral:
					{
					int LA159_35 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case FloatingPointLiteral:
					{
					int LA159_36 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case CharacterLiteral:
					{
					int LA159_37 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case StringLiteral:
					{
					int LA159_38 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 82:
				case 115:
					{
					int LA159_39 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 98:
					{
					int LA159_40 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 97:
					{
					int LA159_41 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 118:
					{
					int LA159_42 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				default:
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 159, 3, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
				}
				break;
			case CharacterLiteral:
			case DecimalLiteral:
			case FloatingPointLiteral:
			case HexLiteral:
			case Identifier:
			case OctalLiteral:
			case StringLiteral:
			case 53:
			case 65:
			case 67:
			case 70:
			case 71:
			case 77:
			case 79:
			case 80:
			case 82:
			case 85:
			case 92:
			case 94:
			case 97:
			case 98:
			case 105:
			case 108:
			case 111:
			case 115:
			case 118:
				{
				alt159=4;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 159, 0, input);
				throw nvae;
			}
			switch (alt159) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1204:9: '~' unaryExpression
					{
					match(input,126,FOLLOW_126_in_unaryExpressionNotPlusMinus5549); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus5551);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1205:8: '!' unaryExpression
					{
					match(input,29,FOLLOW_29_in_unaryExpressionNotPlusMinus5560); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus5562);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1206:9: castExpression
					{
					pushFollow(FOLLOW_castExpression_in_unaryExpressionNotPlusMinus5572);
					castExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:9: primary ( selector )* ( '++' | '--' )?
					{
					pushFollow(FOLLOW_primary_in_unaryExpressionNotPlusMinus5582);
					primary();
					state._fsp--;
					if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:17: ( selector )*
					loop157:
					while (true) {
						int alt157=2;
						int LA157_0 = input.LA(1);
						if ( (LA157_0==47||LA157_0==59) ) {
							alt157=1;
						}

						switch (alt157) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:17: selector
							{
							pushFollow(FOLLOW_selector_in_unaryExpressionNotPlusMinus5584);
							selector();
							state._fsp--;
							if (state.failed) return;
							}
							break;

						default :
							break loop157;
						}
					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:27: ( '++' | '--' )?
					int alt158=2;
					int LA158_0 = input.LA(1);
					if ( (LA158_0==41||LA158_0==45) ) {
						alt158=1;
					}
					switch (alt158) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( input.LA(1)==41||input.LA(1)==45 ) {
								input.consume();
								state.errorRecovery=false;
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								throw mse;
							}
							}
							break;

					}

					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 125, unaryExpressionNotPlusMinus_StartIndex); }

		}
	}
579882
@Override
	public StreamOperatorStateContext streamOperatorStateContext(
		@Nonnull OperatorID operatorID,
		@Nonnull String operatorClassName,
		@Nonnull KeyContext keyContext,
		@Nullable TypeSerializer<?> keySerializer,
		@Nonnull CloseableRegistry streamTaskCloseableRegistry,
		@Nonnull MetricGroup metricGroup) throws Exception {

		TaskInfo taskInfo = environment.getTaskInfo();
		OperatorSubtaskDescriptionText operatorSubtaskDescription =
			new OperatorSubtaskDescriptionText(
				operatorID,
				operatorClassName,
				taskInfo.getIndexOfThisSubtask(),
				taskInfo.getNumberOfParallelSubtasks());

		final String operatorIdentifierText = operatorSubtaskDescription.toString();

		final PrioritizedOperatorSubtaskState prioritizedOperatorSubtaskStates =
			taskStateManager.prioritizedOperatorState(operatorID);

		AbstractKeyedStateBackend<?> keyedStatedBackend = null;
		OperatorStateBackend operatorStateBackend = null;
		CloseableIterable<KeyGroupStatePartitionStreamProvider> rawKeyedStateInputs = null;
		CloseableIterable<StatePartitionStreamProvider> rawOperatorStateInputs = null;
		InternalTimeServiceManager<?> timeServiceManager;

		try {

			// -------------- Keyed State Backend --------------
			keyedStatedBackend = keyedStatedBackend(
				keySerializer,
				operatorIdentifierText,
				prioritizedOperatorSubtaskStates,
				streamTaskCloseableRegistry,
				metricGroup);

			// -------------- Operator State Backend --------------
			operatorStateBackend = operatorStateBackend(
				operatorIdentifierText,
				prioritizedOperatorSubtaskStates,
				streamTaskCloseableRegistry);

			// -------------- Raw State Streams --------------
			rawKeyedStateInputs = rawKeyedStateInputs(
				prioritizedOperatorSubtaskStates.getPrioritizedRawKeyedState().iterator());
			streamTaskCloseableRegistry.registerCloseable(rawKeyedStateInputs);

			rawOperatorStateInputs = rawOperatorStateInputs(
				prioritizedOperatorSubtaskStates.getPrioritizedRawOperatorState().iterator());
			streamTaskCloseableRegistry.registerCloseable(rawOperatorStateInputs);

			// -------------- Internal Timer Service Manager --------------
			timeServiceManager = internalTimeServiceManager(keyedStatedBackend, keyContext, rawKeyedStateInputs);

			// -------------- Preparing return value --------------

			return new StreamOperatorStateContextImpl(
				prioritizedOperatorSubtaskStates.isRestored(),
				operatorStateBackend,
				keyedStatedBackend,
				timeServiceManager,
				rawOperatorStateInputs,
				rawKeyedStateInputs);
		} catch (Exception ex) {

			// cleanup if something went wrong before results got published.
			if (keyedStatedBackend != null) {
				if (streamTaskCloseableRegistry.unregisterCloseable(keyedStatedBackend)) {
					IOUtils.closeQuietly(keyedStatedBackend);
				}
				// release resource (e.g native resource)
				keyedStatedBackend.dispose();
			}

			if (operatorStateBackend != null) {
				if (streamTaskCloseableRegistry.unregisterCloseable(operatorStateBackend)) {
					IOUtils.closeQuietly(operatorStateBackend);
				}
				operatorStateBackend.dispose();
			}

			if (streamTaskCloseableRegistry.unregisterCloseable(rawKeyedStateInputs)) {
				IOUtils.closeQuietly(rawKeyedStateInputs);
			}

			if (streamTaskCloseableRegistry.unregisterCloseable(rawOperatorStateInputs)) {
				IOUtils.closeQuietly(rawOperatorStateInputs);
			}

			throw new Exception("Exception while creating StreamOperatorStateContext.", ex);
		}
	}
1247985
public static <T, U> ToDoubleBiFunction<T, U> toDoubleBiFunction(CheckedToDoubleBiFunction<T, U> function, Consumer<Throwable> handler) {
        return (t, u) -> {
            try {
                return function.applyAsDouble(t, u);
            }
            catch (Throwable e) {
                handler.accept(e);

                throw new IllegalStateException("Exception handler must throw a RuntimeException", e);
            }
        };
    }
826330
private static MethodHandle unmapJava7Or8(MethodHandles.Lookup lookup) throws ReflectiveOperationException
  {
    // "Compile" a MethodHandle that is roughly equivalent to the following lambda:
    //
    // (ByteBuffer buffer) -> {
    //   sun.misc.Cleaner cleaner = ((java.nio.DirectByteBuffer) byteBuffer).cleaner();
    //   if (nonNull(cleaner))
    //     cleaner.clean();
    //   else
    //     noop(cleaner); // the noop is needed because MethodHandles#guardWithTest always needs both if and else
    // }
    //
    Class<?> directBufferClass = Class.forName("java.nio.DirectByteBuffer");
    Method m = directBufferClass.getMethod("cleaner");
    m.setAccessible(true);
    MethodHandle directBufferCleanerMethod = lookup.unreflect(m);
    Class<?> cleanerClass = directBufferCleanerMethod.type().returnType();
    MethodHandle cleanMethod = lookup.findVirtual(cleanerClass, "clean", MethodType.methodType(void.class));
    MethodHandle nonNullTest = lookup.findStatic(Objects.class, "nonNull",
                                                 MethodType.methodType(boolean.class, Object.class)
    ).asType(MethodType.methodType(boolean.class, cleanerClass));
    MethodHandle noop = MethodHandles.dropArguments(MethodHandles.constant(
        Void.class,
        null
    ).asType(MethodType.methodType(void.class)), 0, cleanerClass);
    MethodHandle unmapper = MethodHandles.filterReturnValue(
        directBufferCleanerMethod,
        MethodHandles.guardWithTest(nonNullTest, cleanMethod, noop)
    ).asType(MethodType.methodType(void.class, ByteBuffer.class));
    return unmapper;
  }
816051
@Override
	OperatorStateHandle closeAndGetHandle() throws IOException {
		StreamStateHandle streamStateHandle = delegate.closeAndGetHandle();

		if (null == streamStateHandle) {
			return null;
		}

		if (partitionOffsets.isEmpty() && delegate.getPos() > initialPosition) {
			startNewPartition();
		}

		Map<String, OperatorStateHandle.StateMetaInfo> offsetsMap = new HashMap<>(1);

		OperatorStateHandle.StateMetaInfo metaInfo =
				new OperatorStateHandle.StateMetaInfo(
						partitionOffsets.toArray(),
					OperatorStateHandle.Mode.SPLIT_DISTRIBUTE);

		offsetsMap.put(DefaultOperatorStateBackend.DEFAULT_OPERATOR_STATE_NAME, metaInfo);

		return new OperatorStreamStateHandle(offsetsMap, streamStateHandle);
	}
501659
public <T> T runUnchecked(Retryable<T> operation) throws RuntimeException
	{
		try
		{
			return run(operation);
		}
		catch (RuntimeException e)
		{
			throw e;
		}
		catch (Exception e)
		{
			throw new RuntimeException("Retryable " + operation + " failed: " + e.getMessage(), e);
		}
	}
356455
@Override
	@SuppressWarnings("unchecked")
	public UnaryOperatorInformation<IN, OUT> getOperatorInfo() {
		return (UnaryOperatorInformation<IN, OUT>) this.operatorInfo;
	}
843654
def unary_operator(op):
    
    valid_ops = {'~'}
    if op not in valid_ops:
        raise ValueError("Invalid unary operator %s." % op)

    def unary_operator(self):
        # This can't be hoisted up a scope because the types returned by
        # unary_op_return_type aren't defined when the top-level function is
        # invoked.
        if isinstance(self, NumericalExpression):
            return NumExprFilter.create(
                "{op}({expr})".format(op=op, expr=self._expr),
                self.inputs,
            )
        else:
            return NumExprFilter.create("{op}x_0".format(op=op), (self,))

    unary_operator.__doc__ = "Unary Operator: '%s'" % op
    return unary_operator
998443
private void addOperator(final String operator) {
        // This should never happen but sanity check...
        Validate.notNull(operator);

        if(lastOperator == null) {
            lastOperator = operator;
        }

        /* Logic to determine whether to put parentheses around the existing fieldtext. This is tied to the use of the
         * NOT operator as it also adds parentheses.
         */
        if(not) {
            if(componentCount == 1) {
                fieldTextString.insert(0, "NOT+");
            } else {
                fieldTextString.insert(0, "NOT(").append(')');
            }
        } else if(!lastOperator.equals(operator)) {
            fieldTextString.insert(0, '(').append(')');
        }

        lastOperator = operator;

        fieldTextString.append('+').append(operator).append('+');
    }
918721
def unary_operation(self, rule, right, **kwargs):
        
        return self.evaluate_unop(rule.operation, right, **kwargs)
225594
private function _checkUnaryOperator() {
		if ($this->_isActive('checkUnaryOperator')) {
			// If the control statement is not listed as an exception
			if (!$this->_config->isException('checkUnaryOperator', $this->_currentStatement) || ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_ARRAY)) {
				// And if we are currently in a control statement or an array statement
				if ($this->_inControlStatement || ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_ARRAY)) {
					$this->_writeError('checkUnaryOperator', $this->_getMessage('UNARY_OPERATOR'));
				}
			}
		}
	}
1038060
protected String naryOperator(final NAryOperator operator, final String opString) {
        final StringBuilder sb = new StringBuilder();
        int count = 0;
        final int size = operator.numberOfOperands();
        Formula last = null;
        for (final Formula op : operator) {
            if (++count == size) {
                last = op;
            } else {
                sb.append(operator.type().precedence() < op.type().precedence() ? this.toString(op) : this.bracket(op));
                sb.append(opString);
            }
        }
        if (last != null) {
            sb.append(operator.type().precedence() < last.type().precedence() ? this.toString(last) : this.bracket(last));
        }
        return sb.toString();
    }
860940
public final BaseDescr unaryExpression() throws RecognitionException {
		BaseDescr result = null;


		BaseDescr ue =null;
		ParserRuleReturnScope left =null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:467:5: ( PLUS ue= unaryExpression | MINUS ue= unaryExpression | INCR primary | DECR primary |left= unaryExpressionNotPlusMinus )
			int alt49=5;
			switch ( input.LA(1) ) {
			case PLUS:
				{
				alt49=1;
				}
				break;
			case MINUS:
				{
				alt49=2;
				}
				break;
			case INCR:
				{
				alt49=3;
				}
				break;
			case DECR:
				{
				alt49=4;
				}
				break;
			case BOOL:
			case DECIMAL:
			case FLOAT:
			case HEX:
			case ID:
			case LEFT_PAREN:
			case LEFT_SQUARE:
			case LESS:
			case NEGATION:
			case NULL:
			case STAR:
			case STRING:
			case TILDE:
			case TIME_INTERVAL:
				{
				alt49=5;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return result;}
				NoViableAltException nvae =
					new NoViableAltException("", 49, 0, input);
				throw nvae;
			}
			switch (alt49) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:467:9: PLUS ue= unaryExpression
					{
					match(input,PLUS,FOLLOW_PLUS_in_unaryExpression2269); if (state.failed) return result;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpression2273);
					ue=unaryExpression();
					state._fsp--;
					if (state.failed) return result;
					if ( state.backtracking==0 ) { if( buildDescr ) {
					            result = ue;
					            if( result instanceof AtomicExprDescr ) {
					                ((AtomicExprDescr)result).setExpression( "+" + ((AtomicExprDescr)result).getExpression() );
					            }
					        } }
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:474:7: MINUS ue= unaryExpression
					{
					match(input,MINUS,FOLLOW_MINUS_in_unaryExpression2291); if (state.failed) return result;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpression2295);
					ue=unaryExpression();
					state._fsp--;
					if (state.failed) return result;
					if ( state.backtracking==0 ) { if( buildDescr ) {
					            result = ue;
					            if( result instanceof AtomicExprDescr ) {
					                ((AtomicExprDescr)result).setExpression( "-" + ((AtomicExprDescr)result).getExpression() );
					            }
					        } }
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:481:9: INCR primary
					{
					match(input,INCR,FOLLOW_INCR_in_unaryExpression2315); if (state.failed) return result;
					pushFollow(FOLLOW_primary_in_unaryExpression2317);
					primary();
					state._fsp--;
					if (state.failed) return result;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:482:9: DECR primary
					{
					match(input,DECR,FOLLOW_DECR_in_unaryExpression2327); if (state.failed) return result;
					pushFollow(FOLLOW_primary_in_unaryExpression2329);
					primary();
					state._fsp--;
					if (state.failed) return result;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:483:9: left= unaryExpressionNotPlusMinus
					{
					pushFollow(FOLLOW_unaryExpressionNotPlusMinus_in_unaryExpression2341);
					left=unaryExpressionNotPlusMinus();
					state._fsp--;
					if (state.failed) return result;
					if ( state.backtracking==0 ) { if( buildDescr ) { result = (left!=null?((DRL5Expressions.unaryExpressionNotPlusMinus_return)left).result:null); } }
					}
					break;

			}
		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
		return result;
	}
1141435
@Benchmark
  public Object blockingUnary() throws Exception {
    return ClientCalls.blockingUnaryCall(
        channels[0].newCall(unaryMethod, CallOptions.DEFAULT), Unpooled.EMPTY_BUFFER);
  }
1310394
@Override
    public StreamT<W,T> iterate(UnaryOperator<T> fn, T alt) {

        return super.iterate(fn,alt);
    }
701722
public final void unaryExpression() throws RecognitionException {
		int unaryExpression_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 124) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1196:5: ( '+' unaryExpression | '-' unaryExpression | '++' primary | '--' primary | unaryExpressionNotPlusMinus )
			int alt156=5;
			switch ( input.LA(1) ) {
			case 40:
				{
				alt156=1;
				}
				break;
			case 44:
				{
				alt156=2;
				}
				break;
			case 41:
				{
				alt156=3;
				}
				break;
			case 45:
				{
				alt156=4;
				}
				break;
			case CharacterLiteral:
			case DecimalLiteral:
			case FloatingPointLiteral:
			case HexLiteral:
			case Identifier:
			case OctalLiteral:
			case StringLiteral:
			case 29:
			case 36:
			case 53:
			case 65:
			case 67:
			case 70:
			case 71:
			case 77:
			case 79:
			case 80:
			case 82:
			case 85:
			case 92:
			case 94:
			case 97:
			case 98:
			case 105:
			case 108:
			case 111:
			case 115:
			case 118:
			case 126:
				{
				alt156=5;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 156, 0, input);
				throw nvae;
			}
			switch (alt156) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1196:9: '+' unaryExpression
					{
					match(input,40,FOLLOW_40_in_unaryExpression5484); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpression5486);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1197:7: '-' unaryExpression
					{
					match(input,44,FOLLOW_44_in_unaryExpression5494); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpression5496);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1198:9: '++' primary
					{
					match(input,41,FOLLOW_41_in_unaryExpression5506); if (state.failed) return;
					pushFollow(FOLLOW_primary_in_unaryExpression5508);
					primary();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1199:9: '--' primary
					{
					match(input,45,FOLLOW_45_in_unaryExpression5518); if (state.failed) return;
					pushFollow(FOLLOW_primary_in_unaryExpression5520);
					primary();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1200:9: unaryExpressionNotPlusMinus
					{
					pushFollow(FOLLOW_unaryExpressionNotPlusMinus_in_unaryExpression5530);
					unaryExpressionNotPlusMinus();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 124, unaryExpression_StartIndex); }

		}
	}