@Test
public void pagesHaveTheSameAnnotations() {

    PDAnnotationLink annotation = new PDAnnotationLink();
    PDPageDestination dest = new PDPageFitDestination();
    dest.setPage(oldPage);
    annotation.setDestination(dest);
    PDPage secondOld = new PDPage();
    PDPage secondNew = new PDPage();
    lookup.addLookupEntry(secondOld, secondNew);
    List<PDAnnotation> annotations = Arrays.asList(annotation, new PDAnnotationText());
    oldPage.setAnnotations(annotations);
    secondOld.setAnnotations(annotations);
    PDDocument doc = new PDDocument();
    doc.addPage(oldPage);
    doc.addPage(secondOld);
    new AnnotationsDistiller(doc).retainRelevantAnnotations(lookup);
    assertEquals(oldPage.getAnnotations().size(), newPage.getAnnotations().size());
    assertEquals(secondOld.getAnnotations().size(), secondNew.getAnnotations().size());
}