}
/** Reset the UniqueSernoHelper object and perform the test twice. */
private void testInternal(final boolean indexExpectedToBePresent, final InvocationHandler certificateStoreSessionProxy) throws Exception {
log.trace(">testInternal");
final CertificateStoreSession certificateStoreSessionMock = (CertificateStoreSession) Proxy.newProxyInstance(CertificateStoreSession.class.getClassLoader(), cs, certificateStoreSessionProxy);
UniqueSernoHelper.reset();
// Multiple entries should give the same result, so we run the test twice
if (indexExpectedToBePresent) {
Assert.assertTrue(MOCKED_INDEX_FAILED, UniqueSernoHelper.isUniqueCertificateSerialNumberIndex(certificateStoreSessionMock));
Assert.assertTrue(MOCKED_INDEX_FAILED, UniqueSernoHelper.isUniqueCertificateSerialNumberIndex(certificateStoreSessionMock));