@Test
public void removesParentAndPopup() throws IOException {

    try (PDDocument document = PDFParser.parse(SeekableSources.inMemorySeekableSourceFrom(
            getClass().getClassLoader().getResourceAsStream("pdf/popup_annotation.pdf")))) {
        PDPage page = document.getPage(0);
        PDPage copy = new PageCopier(false).copyOf(page);
        copy.getAnnotations().stream().map(PDAnnotation::getCOSObject).forEach(d -> {
            assertFalse(d.containsKey(COSName.PARENT));
            assertFalse(d.containsKey(COSName.getPDFName("Popup")));
        });
    }
}