@Test
void setPredictionModelName() {

    assertEquals(1, template.getMethodsByName("pmml").size());
    Optional<BlockStmt> retrievedOpt = template.getMethodsByName("pmml").get(0).getBody();
    assertTrue(retrievedOpt.isPresent());
    BlockStmt retrieved = retrievedOpt.get();
    assertTrue(retrieved.getStatement(0) instanceof ExpressionStmt);
    assertTrue(retrieved.getStatement(0).asExpressionStmt().getExpression() instanceof VariableDeclarationExpr);
    VariableDeclarationExpr variableDeclarationExpr = retrieved.getStatement(0).asExpressionStmt().getExpression().asVariableDeclarationExpr();
    Optional<Expression> expressionOpt = variableDeclarationExpr.getVariable(0).getInitializer();
    assertTrue(expressionOpt.isPresent());
    assertTrue(expressionOpt.get() instanceof MethodCallExpr);
    MethodCallExpr methodCallExpr = expressionOpt.get().asMethodCallExpr();
    assertTrue(methodCallExpr.getArgument(0) instanceof StringLiteralExpr);
    pmmlRestResourceGenerator.setPredictionModelName(template);
    try {
        assertEquals(KIE_PMML_MODEL.getName(), methodCallExpr.getArgument(0).asStringLiteralExpr().asString());
    } catch (Exception e) {
        fail(e);
    }
}