@Test
public void outlineLevelsParentHasNoPageDest() {

    PDPage page1 = new PDPage();
    PDDocument document = new PDDocument();
    document.addPage(page1);
    PDDocumentOutline outlines = new PDDocumentOutline();
    PDOutlineItem root = new PDOutlineItem();
    root.setTitle("title");
    PDOutlineItem child = new PDOutlineItem();
    child.setTitle("child");
    PDOutlineItem child2 = new PDOutlineItem();
    child2.setTitle("child2");
    child2.setDestination(page1);
    child.addFirst(child2);
    root.addLast(child);
    outlines.addFirst(root);
    document.getDocumentCatalog().setDocumentOutline(outlines);
    Set<Integer> levels = OutlineUtils.getOutlineLevelsWithPageDestination(document);
    assertEquals(1, levels.size());
    assertTrue(levels.contains(3));
}