@Override
 public void tearDown() throws Exception {
   if (store != null) {
     store.remove(store.getAllCertificates());
     assertTrue(store.getAllCertificates().isEmpty());
   }
 }
  @Override
  public void setUp() throws Exception {
    CertCacheFactory.getInstance().flushAll();

    if (!StringUtils.isEmpty(TestUtils.setupSafeNetToken())) {
      // clean out the token of all private keys
      final PKCS11Credential cred = new BootstrappedPKCS11Credential("1Kingpuff");

      final MutableKeyStoreProtectionManager mgr =
          new StaticPKCS11TokenKeyStoreProtectionManager(cred, "", "");

      store = new CacheableKeyStoreManagerCertificateStore(mgr);

      store.remove(store.getAllCertificates());

      assertTrue(store.getAllCertificates().isEmpty());
    }
  }