@Test
public void testAddToC() throws TaskException {

    MergeParameters params = new MergeParameters();
    params.setTableOfContentsPolicy(ToCPolicy.DOC_TITLES);
    PDDocument doc = new PDDocument();
    assertEquals(0, doc.getNumberOfPages());
    TableOfContentsCreator victim = new TableOfContentsCreator(params, doc);
    victim.appendItem("text", 10, new PDPage());
    victim.addToC();
    assertEquals(1, doc.getNumberOfPages());
}