Source:
<code>public void test_Provider_ConscryptOverridesBouncyCastle() throws Exception { if (StandardNames.IS_RI) { return; } Provider conscrypt = Security.getProvider("AndroidOpenSSL"); Provider bc = Security.getProvider("BC"); Set<String> conscryptAlgs = new HashSet<>(); for (Entry<Object, Object> entry : conscrypt.entrySet()) { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { continue; } conscryptAlgs.add(key); } Set<String> bcClasses = new HashSet<>(); for (String conscryptAlg : conscryptAlgs) { Provider.Service service = getService(bc, conscryptAlg); if (service != null) { bcClasses.add(service.getClassName()); } } assertTrue(bcClasses.size() > 0); Set<String> shouldBeOverriddenBcIds = new HashSet<>(); for (Entry<Object, Object> entry : <START> bc.entrySet()) <END> { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { key = key.substring("Alg.Alias.".length()); } Provider.Service service = getService(bc, key); if (bcClasses.contains(service.getClassName())) { shouldBeOverriddenBcIds.add(key); } } Set<String> nonOverriddenIds = new TreeSet<>(); for (String shouldBeOverridenBcId : shouldBeOverriddenBcIds) { if (getService(conscrypt, shouldBeOverridenBcId) == null) { nonOverriddenIds.add(shouldBeOverridenBcId); } } assertTrue("Conscrypt does not provide IDs " + nonOverriddenIds + ", but it does provide other IDs that point to the same implementation(s)" + " in BouncyCastle.", nonOverriddenIds.isEmpty()); }</code><technical_language>is access key, loop bc.keySet()</technical_language>

Target:
public void test_Provider_ConscryptOverridesBouncyCastle() throws Exception { if (StandardNames.IS_RI) { return; } Provider conscrypt = Security.getProvider("AndroidOpenSSL"); Provider bc = Security.getProvider("BC"); Set<String> conscryptAlgs = new HashSet<>(); for (Entry<Object, Object> entry : conscrypt.entrySet()) { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { continue; } conscryptAlgs.add(key); } Set<String> bcClasses = new HashSet<>(); for (String conscryptAlg : conscryptAlgs) { Provider.Service service = getService(bc, conscryptAlg); if (service != null) { bcClasses.add(service.getClassName()); } } assertTrue(bcClasses.size() > 0); Set<String> shouldBeOverriddenBcIds = new HashSet<>(); for (Object keyObject : bc.keySet()) { String key = (String) keyObject; if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { key = key.substring("Alg.Alias.".length()); } Provider.Service service = getService(bc, key); if (bcClasses.contains(service.getClassName())) { shouldBeOverriddenBcIds.add(key); } } assertTrue(shouldBeOverriddenBcIds.size() > 0); Set<String> nonOverriddenIds = new TreeSet<>(); for (String shouldBeOverridenBcId : shouldBeOverriddenBcIds) { if (getService(conscrypt, shouldBeOverridenBcId) == null) { nonOverriddenIds.add(shouldBeOverridenBcId); } } assertTrue("Conscrypt does not provide IDs " + nonOverriddenIds + ", but it does provide other IDs that point to the same implementation(s)" + " in BouncyCastle.", nonOverriddenIds.isEmpty()); }