ParagraphMarkedClassification implements ContentManipulator { @Override public void manipulate(Document document) { document.select("p").forEach(this::processParagraph); }  @Override void manipulate(Document document);  }
@Test public void testNoMarking() { Document doc = Jsoup.parseBodyFragment("<p>This is some text</p>"); m.manipulate(doc); assertEquals(doc.body().text(), "This is some text"); }
@Test public void testMarking() { Document doc = Jsoup.parseBodyFragment("<p>(UK OFFICIAL)This is some text</p>"); m.manipulate(doc); assertEquals( MarkupUtils.getAttribute(doc.body().select("p").first(), "classification"), "UK OFFICIAL"); assertEquals(doc.body().text(), "This is some text"); }