private int findValidUnaryOperator(List<ExpressionElement> list) {
		// stop 1 before end since you can't end in a valid unary operator

		for (int i = 0; i < list.size() - 1; i++) {
			// check any element in the list if it is a unary operator
			if (list.get(i) instanceof ExpressionOperator op) {
				if (!op.isUnary()) {
					continue;
				}

				// make sure the next element is a value so the caller can cast without fear
				if (list.get(i + 1) instanceof ExpressionValue) {
					return i;
				}
			}
		}
		return -1;
	}
Evaluates a list of valid expression elements into a single final value.
@param list the list of valid expression elements.
@return the final value the expression evaluates to
@throws ExpressionException if sequence of expression elements is not in a valid order such
that it evaluates to a single value. (such as two values not being separated by an operator)
Ghidra/Framework/Generic/src/main/java/generic/expressions/ExpressionEvaluator.java