### Question:
PdfVersionCompatibilityChecker { public boolean isVersionUpgradeRequired() { return pdfVersionOfDocumentToBeSigned < getMinimumCompatiblePdfVersion(); } PdfVersionCompatibilityChecker(String pPdfVersionOfDocumentToBeSigned, String pSignatureDigestAlgorithm); int getPdfVersionOfDocumentToBeSigned(); boolean isVersionUpgradeRequired(); int getMinimumCompatiblePdfVersion();  }### Answer:
@Test public void versionUpgradeRequiredForSha256_PdfVersionIs_0() { PdfVersionCompatibilityChecker checker = new PdfVersionCompatibilityChecker("0", "SHA-256"); boolean upgradeRequired = checker.isVersionUpgradeRequired(); assertTrue(upgradeRequired); }
@Test public void versionUpgradeNotRequiredForSha256_PdfVersionIs_6() { PdfVersionCompatibilityChecker checker = new PdfVersionCompatibilityChecker("6", "SHA-256"); boolean upgradeRequired = checker.isVersionUpgradeRequired(); assertFalse(upgradeRequired); }
@Test public void versionUpgradeRequiredForSha256_PdfVersionIs_NotNumeric() { PdfVersionCompatibilityChecker checker = new PdfVersionCompatibilityChecker("XXXX", "SHA-256"); boolean upgradeRequired = checker.isVersionUpgradeRequired(); assertTrue(upgradeRequired); }
@Test public void versionUpgradeRequiredForSha384_PdfVersionIs_6() { PdfVersionCompatibilityChecker checker = new PdfVersionCompatibilityChecker("6", "SHA-384"); boolean upgradeRequired = checker.isVersionUpgradeRequired(); assertTrue(upgradeRequired); }
@Test public void versionUpgradeNotRequiredForSha384_PdfVersionIs_7() { PdfVersionCompatibilityChecker checker = new PdfVersionCompatibilityChecker("7", "SHA-384"); boolean upgradeRequired = checker.isVersionUpgradeRequired(); assertFalse(upgradeRequired); }