@Test
public void getFieldRefExpressionMethodDeclaration() {

    int methodArity = new Random().nextInt(20);
    FieldRef fieldRef = fieldRefSupplier.get();
    String methodName = String.format(METHOD_NAME_TEMPLATE, fieldRef.getClass().getSimpleName(), methodArity);
    MethodDeclaration retrieved = ExpressionFunctionUtils.getFieldRefExpressionMethodDeclaration(methodName,
                                                                                                 fieldRef,
                                                                                                 STRING_CLASS,
                                                                                                 DEFAULT_PARAMETERTYPE_MAP);
    String expected = String.format("java.lang.String fieldRefVariable = (java.lang.String) kiePMMLNameValue.map" +
                                            "(%1$s::getValue).orElse(%2$s);",
                                    KiePMMLNameValue.class.getName(),
                                    fieldRef.getMapMissingTo());
    commonValidateFieldRefMethod(retrieved, methodName, expected, String.class.getName());
    //
    fieldRef.setMapMissingTo("MAP_MISSING_TO");
    methodName = String.format(METHOD_NAME_TEMPLATE, fieldRef.getClass().getSimpleName(), methodArity);
    retrieved = ExpressionFunctionUtils.getFieldRefExpressionMethodDeclaration(methodName, fieldRef, STRING_CLASS,
                                                                               DEFAULT_PARAMETERTYPE_MAP);
    expected = String.format("java.lang.String fieldRefVariable = (java.lang.String) kiePMMLNameValue.map" +
                                     "(%1$s::getValue).orElse(\"%2$s\");",
                             KiePMMLNameValue.class.getName(),
                             fieldRef.getMapMissingTo());
    commonValidateFieldRefMethod(retrieved, methodName, expected, String.class.getName());
}