BouncyCastleProviderChecker { static boolean isLoaded() { for (Provider p : Security.getProviders()) { if (p.getClass().getName().equals(BouncyCastleProvider.class.getName())) { return true; } } return false; }    }
@Test public void testIsLoaded() { assertFalse(BouncyCastleProviderChecker.isLoaded()); Security.addProvider(new BouncyCastleProvider()); assertTrue(BouncyCastleProviderChecker.isLoaded()); }