### Question:
OcspVerifier { public void verifyValidity(OCSPResp response, X509Certificate subject, X509Certificate issuer) throws Exception { verifyValidity(response, subject, issuer, new Date()); } OcspVerifier(int ocspFreshnessSeconds, OcspVerifierOptions options); void verifyValidityAndStatus(OCSPResp response,
                                        X509Certificate subject, X509Certificate issuer); void verifyValidityAndStatus(OCSPResp response,
                                        X509Certificate subject, X509Certificate issuer, Date atDate); void verifyValidity(OCSPResp response, X509Certificate subject,
                               X509Certificate issuer); void verifyValidity(OCSPResp response, X509Certificate subject,
                               X509Certificate issuer, Date atDate); static void verifyStatus(OCSPResp response); boolean isExpired(SingleResp singleResp, Date atDate); boolean isExpired(OCSPResp response); boolean isExpired(OCSPResp response, Date atDate); static X509Certificate getOcspCert(BasicOCSPResp response);  }### Answer:
@Test public void responseValidityCache() throws Exception { Date thisUpdate = Date.from(Instant.now().plus(1, ChronoUnit.DAYS)); OCSPResp ocsp = OcspTestUtils.createOCSPResponse(subject, issuer, signer, signerKey, CertificateStatus.GOOD, thisUpdate, null); OcspVerifier verifier = new OcspVerifier(GlobalConf.getOcspFreshnessSeconds(true), new OcspVerifierOptions(true)); verifier.verifyValidity(ocsp, subject, issuer); Field field = OcspVerifier.class.getDeclaredField("RESPONSE_VALIDITY_CACHE"); field.setAccessible(true); Cache<String, SingleResp> cache = (Cache<String, SingleResp>)field.get(verifier); assertTrue("Cache should be filled", cache != null && cache.size() > 0); }