public static Optional<VariableDeclarator> getVariableDeclarator(final MethodDeclaration methodDeclaration,
                                                                     final String variableName) {
        final BlockStmt body = methodDeclaration.getBody()
                .orElseThrow(() -> new KiePMMLException(String.format(MISSING_BODY_TEMPLATE, methodDeclaration)));
        return getVariableDeclarator(body, variableName);
    }
@Test
    void getVariableDeclarator() {
        final String variableName = "variableName";
        final BlockStmt body = new BlockStmt();
        assertThat(CommonCodegenUtils.getVariableDeclarator(body, variableName)).isNotPresent();
        final VariableDeclarationExpr variableDeclarationExpr = new VariableDeclarationExpr(parseClassOrInterfaceType("String"), variableName);
        body.addStatement(variableDeclarationExpr);
        Optional<VariableDeclarator> retrieved =  CommonCodegenUtils.getVariableDeclarator(body, variableName);
        assertThat(retrieved).isPresent();
        VariableDeclarator variableDeclarator = retrieved.get();
        assertThat(variableDeclarator.getName().asString()).isEqualTo(variableName);
    }