"<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a" +
"<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a" +
"<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a" +
"<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a";
htmlDoc = new PublicHTMLDocument();
insertMarker = htmlDoc.getInsertMarker();
Marker createMarker = htmlDoc.getCreateMarker();
final ParserDelegator parser = new ParserDelegator();
htmlDoc.setParser(parser);
htmlDoc.setEditable(false);
htmlDoc.setTokenThreshold(1);
Element root = htmlDoc.getDefaultRootElement();
Element branch = root.getElement(0).getElement(0);
htmlDoc.insertAfterStart(branch, longString);
assertFalse(createMarker.isOccurred());
assertTrue(insertMarker.isOccurred());
ArrayList info = (ArrayList)insertMarker.getAuxiliary();
assertNotNull(info);
assertEquals(5, info.size()/2);
assertEquals(2, ((ElementSpec[])(info.get(0))).length);
assertEquals(6, ((ElementSpec[])info.get(2)).length);
assertEquals(26, ((ElementSpec[])info.get(4)).length);
assertEquals(126, ((ElementSpec[])info.get(6)).length);
assertEquals(305, ((ElementSpec[])info.get(8)).length);
assertEquals(1, htmlDoc.getTokenThreshold());
insertMarker.reset();
htmlDoc = new PublicHTMLDocument();
insertMarker = htmlDoc.getInsertMarker();
htmlDoc.setEditable(false);
htmlDoc.setParser(parser);
htmlDoc.setTokenThreshold(2);
root = htmlDoc.getDefaultRootElement();
branch = root.getElement(0).getElement(0);
htmlDoc.insertAfterStart(branch, longString);
assertFalse(createMarker.isOccurred());
assertTrue(insertMarker.isOccurred());
info = (ArrayList)insertMarker.getAuxiliary();
assertNotNull(info);
assertEquals(5, info.size()/2);
assertEquals(4, ((ElementSpec[])info.get(0)).length);
assertEquals(12, ((ElementSpec[])info.get(2)).length);
assertEquals(52, ((ElementSpec[])info.get(4)).length);
assertEquals(252, ((ElementSpec[])info.get(6)).length);
assertEquals(145, ((ElementSpec[])info.get(8)).length);
assertEquals(2, htmlDoc.getTokenThreshold());
insertMarker.reset();
htmlDoc = new PublicHTMLDocument();
insertMarker = htmlDoc.getInsertMarker();
htmlDoc.setEditable(false);
htmlDoc.setParser(parser);
htmlDoc.setTokenThreshold(5);
root = htmlDoc.getDefaultRootElement();