AbstractFilter implements Filter { @Override public String toString() { return encode(); }  @Override String encode(); @Override String toString();  }
@Test public void testToString() { AbstractFilter af = new AbstractFilter() { public StringBuffer encode(StringBuffer buff) { return buff.append("foo"); } }; assertThat(af.toString()).isEqualTo("foo"); }