### Question:
WikiParser extends BrainParser { public void setUseCanonicalFormat(boolean useCanonicalFormat) { this.useCanonicalFormat = useCanonicalFormat; }  void setUseCanonicalFormat(boolean useCanonicalFormat); @Override Note parse(final InputStream inputStream);  }### Answer:
@Test(expected = IOException.class) public void pageIsOnlyAllowedInCanonicalFormat() throws IOException { wikiParser.setUseCanonicalFormat(false); readNotes("* Arthur Dent\n" + "\n" + "He's a jerk.\n" + "A complete kneebiter."); }
@Test public void nonEmptyPageIsCopiedVerbatim() throws Exception { wikiParser.setUseCanonicalFormat(true); List<Note> notes = readNotes("* Arthur Dent\n" + "\n" + "He's a jerk.\n" + "A complete kneebiter."); assertEquals(1, notes.size()); Note root = notes.get(0); assertEquals("Arthur Dent", root.getTitle()); assertEquals("He's a jerk.\nA complete kneebiter.", root.getText()); }
@Test public void emptyPageIsIgnored() throws Exception { wikiParser.setUseCanonicalFormat(true); List<Note> notes = readNotes("* Arthur Dent\n" + "\n" + " "); assertEquals(1, notes.size()); Note root = notes.get(0); assertEquals("Arthur Dent", root.getTitle()); assertNull(root.getText()); }