ParseGraph implements ParseItem { @Override public String toString() { if (this.equals(EMPTY)) { return "pg(EMPTY)"; } if (isEmpty()) { return "pg(terminator:" + definition.getClass().getSimpleName() + ")"; } return "pg(" + head + "," + tail + "," + branched + ")"; } private  ParseGraph(final Token definition); private  ParseGraph(final ParseItem head, final ParseGraph tail, final Token definition, final boolean branched); private  ParseGraph(final ParseItem head, final ParseGraph tail, final Token definition); boolean isEmpty(); Optional<ParseValue> current(); @Override boolean isGraph(); @Override ParseGraph asGraph(); @Override Token getDefinition(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); final ParseItem head; final ParseGraph tail; final boolean branched; final Token definition; final long size; static final Token NONE; static final ParseGraph EMPTY; }
@Test public void testNone() { assertEquals("None", NONE.toString()); thrown.expect(IllegalStateException.class); thrown.expectMessage("This placeholder may not be invoked."); NONE.parse(env(stream())); }
@Test public void testSimpleToString() { assertThat(pg.toString(), is("pg(pval(h:0x68),pg(pval(g:0x67),pg(pg(pval(f:0x66),pg(pg(pval(e:0x65),pg(pval(d:0x64),pg(terminator:Def),false),false),pg(pval(c:0x63),pg(terminator:Def),false),false),false),pg(pval(b:0x62),pg(pval(a:0x61),pg(EMPTY),false),false),false),false),false)")); }
@Test public void testCycleToString() { assertThat(pgc.toString(), is("pg(pg(pref(@0),pg(pval(b:0x62),pg(terminator:Def),false),false),pg(pval(a:0x61),pg(EMPTY),false),false)")); }
@Test public void testLongToString() { assertThat(pgl.toString(), is("pg(pg(pval(f:0x66),pg(terminator:Def),false),pg(pval(e:0x65),pg(pg(pg(pval(d:0x64),pg(terminator:Def),false),pg(pval(c:0x63),pg(pg(terminator:Def),pg(pg(pval(b:0x62),pg(terminator:Def),false),pg(terminator:Def),false),false),false),false),pg(pval(a:0x61),pg(EMPTY),false),false),false),false)")); }