@Test
public void multiplePages() {

    PDDocument document = mock(PDDocument.class);
    PDPage page1 = mock(PDPage.class);
    when(page1.getRotation()).thenReturn(180);
    when(document.getPage(0)).thenReturn(page1);
    PDPage page2 = mock(PDPage.class);
    when(page2.getRotation()).thenReturn(90);
    when(document.getPage(1)).thenReturn(page2);
    when(document.getNumberOfPages()).thenReturn(2);
    PdfRotator victim = new PdfRotator(document);
    new HashSet<>(Arrays.asList(1, 2)).forEach(page -> victim.rotate(page, Rotation.DEGREES_270));
    verify(page1).setRotation(90);
    verify(page2).setRotation(0);
}