@Test
public void testRegisterKeyManager_deprecated_MoreRestrictedNewKeyAllowed_shouldWork()
    throws Exception {

  String typeUrl = "typeUrl";
  Registry.registerKeyManager(typeUrl, new CustomAeadKeyManager(typeUrl));
  try {
    Registry.registerKeyManager(typeUrl, new CustomAeadKeyManager(typeUrl), false);
  } catch (GeneralSecurityException e) {
    fail("repeated registrations of the same key manager should work");
  }
}