@Test
public void testGetNextMatchElement() {
search = null;
search = new TextNavigation("delete", doc);
OdfWhitespaceProcessor textProcessor = new OdfWhitespaceProcessor();
try {
//NodeList list = doc.getContentDom().getElementsByTagName("text:p");
OdfElement firstmatch = (OdfElement) search.getNextMatchElement(doc.getContentRoot());
Assert.assertNotNull(firstmatch);
Assert.assertEquals("Task2.delete next paragraph", textProcessor.getText(firstmatch));
OdfElement secondmatch = (OdfElement) search.getNextMatchElement(firstmatch);
Assert.assertNotNull(secondmatch);
Assert.assertEquals("Hello [delete], I will be delete", textProcessor.getText(secondmatch));
OdfElement thirdmatch = (OdfElement) search.getNextMatchElement(secondmatch);
Assert.assertNotNull(thirdmatch);
Assert.assertEquals("indeed delete", textProcessor.getText(thirdmatch));
OdfElement match4 = (OdfElement) search.getNextMatchElement(thirdmatch);
Assert.assertNotNull(match4);
Assert.assertEquals("different span in one single word delete indeed", textProcessor.getText(match4));
OdfElement match5 = (OdfElement) search.getNextMatchElement(match4);
Assert.assertNotNull(match5);
Assert.assertEquals("Hello delete this word delete true delete indeed", textProcessor.getText(match5));
} catch (Exception e) {
Logger.getLogger(TextNavigationTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
}