BoolConstantExpr extends ConstantExpr { @Override public BoolConstantExpr clone() { return new BoolConstantExpr(isTrue); } BoolConstantExpr(boolean isTrue); @Override boolean hasChild(IAstNode child); @Override void accept(IAstVisitor visitor); @Override BoolConstantExpr clone(); @Override String toString(); boolean getIsTrue();  }
@Test public void testClone() throws Exception { final BoolConstantExpr trueExpr = new BoolConstantExpr(true); final BoolConstantExpr falseExpr = new BoolConstantExpr(false); assertNotSame(trueExpr, trueExpr.clone()); assertNotSame(falseExpr, falseExpr.clone()); assertEquals(trueExpr.getIsTrue(), trueExpr.clone().getIsTrue()); assertEquals(falseExpr.getIsTrue(), falseExpr.clone().getIsTrue()); assertTrue(trueExpr.getIsTrue()); assertFalse(falseExpr.getIsTrue()); }