Mirror implements Iterable<Parser> { @Override public String toString() { return getClass().getSimpleName() + " of " + parser.toString(); } private  Mirror(Parser parser); static Mirror of(Parser parser); @Override String toString(); @Override Iterator<Parser> iterator(); Stream<Parser> stream(); Parser transform(Function<Parser, Parser> transformer);  }
@Test public void testToString() { Parser parser = lowerCase(); Mirror mirror = Mirror.of(parser); assertEquals("CharacterParser[lowercase letter expected]", parser.toString()); assertEquals("Mirror of CharacterParser[lowercase letter expected]", mirror.toString()); }