BlockImpl extends BaseLocatable implements Block, BodyPageElement, RenderCommand { @Override public String toString() { return String.format("Block[%s, at %s]", description, getLocation()); } BlockImpl(Location location, String description); void addToBody(RenderCommand element); void render(MarkupWriter writer, RenderQueue queue); @Override String toString();  }
@Test public void to_string() { Resource r = new ClasspathResource("foo/pages/MyPage.tml"); Location l = new LocationImpl(r, 23); BlockImpl block = new BlockImpl(l, "test block"); assertEquals(block.toString(), "Block[test block, at classpath:foo/pages/MyPage.tml, line 23]"); }