### Question:
DefaultSAMBoxLoader implements PdfLoader<PDDocument> { @Override public void accept(PDDocument document, PdfDocumentDescriptor descriptor) { descriptor.pages(document.getNumberOfPages()); descriptor.setVersion(getVersion(document.getVersion())); PDDocumentInformation info = document.getDocumentInformation(); descriptor.putInformation(PdfMetadataFields.TITLE, info.getTitle()); descriptor.putInformation(PdfMetadataFields.AUTHOR, info.getAuthor()); descriptor.putInformation(PdfMetadataFields.CREATOR, info.getCreator()); descriptor.putInformation(PdfMetadataFields.SUBJECT, info.getSubject()); descriptor.putInformation(PdfMetadataFields.KEYWORDS, info.getKeywords()); descriptor.putInformation("Producer", info.getProducer()); Optional.ofNullable(info.getCreationDate()).map(FORMATTER::format) .ifPresent(c -> descriptor.putInformation("FormattedCreationDate", c)); }  @Override void accept(PDDocument document, PdfDocumentDescriptor descriptor); @Override RequiredPdfData key();  }### Answer:
@Test public void accept() { new DefaultSAMBoxLoader().accept(document, descriptor); assertEquals(2, descriptor.pages().getValue().intValue()); assertEquals(PdfVersion.VERSION_1_4, descriptor.getVersion()); assertEquals("Chuck Norris", descriptor.getInformation(PdfMetadataFields.AUTHOR)); assertEquals("Roundhause", descriptor.getInformation(PdfMetadataFields.SUBJECT)); assertNotNull(descriptor.getInformation("FormattedCreationDate")); assertTrue(isEmpty(descriptor.getInformation(PdfMetadataFields.KEYWORDS))); assertTrue(isEmpty(descriptor.getInformation(PdfMetadataFields.CREATOR))); assertTrue(isEmpty(descriptor.getInformation(PdfMetadataFields.TITLE))); }