private String toTernaryTermExpression(Field field, TypeReference resultType, TernaryTerm ternaryTerm, Function<VariableLiteral, String> variableExpressionGenerator, Tracer tracer) {
        tracer = tracer.dive("ternary term instanceOf");
        if ("if".equals(ternaryTerm.getOperation())) {
            Term a = ternaryTerm.getA();
            Term b = ternaryTerm.getB();
            Term c = ternaryTerm.getC();
            return tracer +
                "(" +
                "(" + toExpression(field, BOOL_TYPE_REFERENCE, a, variableExpressionGenerator) + ") ? " +
                toExpression(field, resultType, b, variableExpressionGenerator) + " : " +
                toExpression(field, resultType, c, variableExpressionGenerator) + "" +
                ")";
        } else {
            throw new IllegalArgumentException("Unsupported ternary operation type " + ternaryTerm.getOperation() + ". Actual type " + resultType);
        }
    }
@param field               this generally only is needed in order to access field attributes such as encoding etc.
@param resultType          the type the resulting expression should have
@param term                the term representing the expression
@param serializerArguments any serializer arguments, which could be referenced in expressions (Needed for getting the type)
@return Java code which does the things defined in 'term'
code-generation/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageTemplateHelper.java