### Question:
PdfParser { public static int getNumOfPages(String pdfFile) throws IOException { PDDocument pdf = PDDocument.load(new File(pdfFile)); int count = pdf.getNumberOfPages(); pdf.close(); return count; }  static int getNumOfPages(String pdfFile);  }### Answer:
@Test public void testGetNumOfPages() throws IOException { int num = PdfParser.getNumOfPages("G:/19cbooksNew/674840.dat"); assertTrue(num==22); }