CastExp extends NestedExp { @Override protected String getCode() { return code; } CastExp(Class<?> castClass, NestedExp exp);  CastExp(CtClass castClass, NestedExp exp); private  CastExp(String code); static CastExp forReturnType(NestedExp exp);  }
@Test public void testCastExpForClass() { assertEquals("((java.lang.String) \"stringValue\")", new CastExp(String.class, new ValueExp("stringValue")).getCode()); }
@Test public void testCastExpForCtClass() throws Exception { CtClass stringClass = ClassPool.getDefault().get(String.class.getName()); assertEquals("((java.lang.String) \"stringValue\")", new CastExp(stringClass, new ValueExp("stringValue")).getCode()); }