Post extends Token { @Override public String toString() { return getClass().getSimpleName() + "(" + makeNameFragment() + token + "," + predicate + ")"; } Post(final String name, final Token token, final Expression predicate, final Encoding encoding); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); final Token token; final Expression predicate; }
@Test public void testToString() { final Token simpleWhile = post("pname", def("value", con(1)), eq(con(1))); final String simpleWhileString = "Post(pname,Def(value,Const(0x01)),Eq(Const(0x01)))"; assertThat(simpleWhile.toString(), is(equalTo(simpleWhileString))); }