@Test
public void transformMethodExpressionToMethodCallWithInlineCast() {

    typeResolver.addImport("org.drools.modelcompiler.domain.InternationalAddress");
    final DrlxExpression expr = DrlxParseUtil.parseExpression("address#InternationalAddress.state");
    final MethodCallExpr expected = StaticJavaParser.parseExpression("((InternationalAddress)getAddress()).getState()");
    assertEquals(expected.toString(), new ToMethodCall(typeResolver).toMethodCallWithClassCheck(expr.getExpr(), null, Person.class).getExpression().toString());
}