BooleanExp extends NestedExp { public BooleanExp and(NestedExp exp) { return new BooleanExp("(" + code + " && " + exp.getCode() + ")"); } BooleanExp(NestedExp exp); protected  BooleanExp(String code); static BooleanExp valueOf(boolean value); BooleanExp and(NestedExp exp); BooleanExp or(NestedExp exp); BooleanExp not(); static final BooleanExp TRUE; static final BooleanExp FALSE; }
@Test public void testAnd() { assertEquals("(true && false)", BooleanExp.TRUE.and(BooleanExp.FALSE).getCode()); }