CastExp extends NestedExp { public static CastExp forReturnType(NestedExp exp) { return new CastExp("(($r) " + exp.getCode() + ")"); } CastExp(Class<?> castClass, NestedExp exp);  CastExp(CtClass castClass, NestedExp exp); private  CastExp(String code); static CastExp forReturnType(NestedExp exp);  }
@Test public void testForReturnType() { assertEquals("(($r) \"stringValue\")", CastExp.forReturnType(new ValueExp("stringValue")).getCode()); }