HttpWriter { public String toString() { verifyState(State.FINALIZED); return builder.toString(); } HttpWriter(); HttpWriter addTitle(String title); HttpWriter write(String paragraph); HttpWriter writeLink(String name, String link); String toString();  }
@Test public void testStructure() { HttpWriter writer = new HttpWriter(); String header = defaultHeader.replace(defaultTitle, "Untitled page"); assertEquals(header + defaultFooter, writer.toString()); }