### Question:
PageCountServiceImpl implements PageCountService { @Override @Deprecated public int getNumberOfPages(String mimeType, byte[] data) throws IOException { File file = null; try { file = File.createTempFile("arkcase-get-number-of-pages-", null); FileUtils.writeByteArrayToFile(file, data); return getNumberOfPages(mimeType, file); } finally { FileUtils.deleteQuietly(file); } }  @Override @Deprecated /** * @deprecated use getNumberOfPages(String, File) */ int getNumberOfPages(String mimeType, byte[] data); @Override int getNumberOfPages(String mimeType, File file);  }### Answer:
@Test public void findPageCountForLargePdf() throws Exception { Resource classPathResource = new ClassPathResource("adobe/oversized.pdf"); String mimeType = "application/pdf"; int numberOfPages = unit.getNumberOfPages(mimeType, classPathResource.getFile()); LOGGER.debug("Number of pages found: [{}]", numberOfPages); }