CompareExp extends BooleanExp { public CompareExp isNotEqual(NestedExp exp) { return new CompareExp("!" + code + ".equals(" + exp.getCode() + ")"); } CompareExp(NestedExp exp); private  CompareExp(String code); CompareExp eq(NestedExp exp); CompareExp ne(NestedExp exp); CompareExp gt(NestedExp exp); CompareExp ge(NestedExp exp); CompareExp lt(NestedExp exp); CompareExp le(NestedExp exp); CompareExp isEqual(NestedExp exp); CompareExp isNotEqual(NestedExp exp);  }
@Test public void testIsNotEqual() { assertEquals("!\"firstString\".equals(\"secondString\")", new CompareExp(new ValueExp("firstString")) .isNotEqual(new ValueExp("secondString")).getCode()); }