@Test
public void doesntRemoveActionWithoutDestination() throws IOException {

    try (PDDocument document = PDFParser.parse(SeekableSources.inMemorySeekableSourceFrom(
            getClass().getClassLoader().getResourceAsStream("pdf/forms/simple_form_with_full_dic.pdf")))) {
        PDPage page = document.getPage(0);
        PDAnnotationLink link = new PDAnnotationLink();
        PDActionGoTo action = new PDActionGoTo();
        link.setAction(action);
        page.setAnnotations(Arrays.asList(link));
        PDPage copy = new PageCopier(false).copyOf(page);
        assertEquals(page.getCOSObject().getDictionaryObject(COSName.ANNOTS),
                page.getCOSObject().getDictionaryObject(COSName.ANNOTS));
        assertNotEquals(page.getCOSObject().getDictionaryObject(COSName.ANNOTS),
                copy.getCOSObject().getDictionaryObject(COSName.ANNOTS));
        copy.getAnnotations().stream().map(PDAnnotation::getCOSObject).forEach(d -> {
            assertFalse(d.containsKey(COSName.P));
            assertFalse(d.containsKey(COSName.DEST));
            assertTrue(d.containsKey(COSName.A));
        });
    }
}