@Test
public void destinationTypeIsPreservedInLeaves() throws IOException {

    try (PDDocument document = PDFParser.parse(SeekableSources.inMemorySeekableSourceFrom(
            getClass().getClassLoader().getResourceAsStream("pdf/large_outline.pdf")))) {
        mapping.addLookupEntry(document.getPage(2), new PDPage());
        PDDocumentOutline outline = new PDDocumentOutline();
        new OutlineDistiller(document).appendRelevantOutlineTo(outline, mapping);
        PDDestination clonedDest = outline.getFirstChild().getDestination();
        assertThat(clonedDest, is(instanceOf(PDPageFitWidthDestination.class)));
        assertEquals(806, ((PDPageFitWidthDestination) clonedDest).getTop());
    }
}