@Test
public void getVariableDeclarator() {

    final String variableName = "variableName";
    final BlockStmt body = new BlockStmt();
    assertFalse(CommonCodegenUtils.getVariableDeclarator(body, variableName).isPresent());
    final VariableDeclarationExpr variableDeclarationExpr = new VariableDeclarationExpr(parseClassOrInterfaceType("String"), variableName);
    body.addStatement(variableDeclarationExpr);
    Optional<VariableDeclarator> retrieved =  CommonCodegenUtils.getVariableDeclarator(body, variableName);
    assertTrue(retrieved.isPresent());
    VariableDeclarator variableDeclarator = retrieved.get();
    assertEquals(variableName, variableDeclarator.getName().asString());
}