TryExp extends StandaloneExp { public void addFinally(StandaloneExp finallyExp) { this.finallyExp = finallyExp; } TryExp(StandaloneExp body); void addFinally(StandaloneExp finallyExp); void addCatch(Class<?> catchClass, StandaloneExp catchExp); @Override String getCode(); NestedExp getCatchClauseVar(int num);  }
@Test public void testAddFinally() { TryExp exp = new TryExp(new IfExp(BooleanExp.TRUE)); exp.addFinally(new IfExp(BooleanExp.TRUE)); assertEquals("\ntry {\nif (true) {\n}\n} finally {\nif (true) {\n}\n}", exp.getCode()); }