Program: 111311
Project: 111311
Buggy source:
@Test public void testKeyManagerRegistration() throws Exception {
  Registry registry=new Registry();
  String mac1TypeUrl=Mac1KeyManager.class.getSimpleName();
  String mac2TypeUrl=Mac2KeyManager.class.getSimpleName();
  String aeadTypeUrl=AeadKeyManager.class.getSimpleName();
  registry.registerKeyManager(mac1TypeUrl,new Mac1KeyManager());
  registry.registerKeyManager(mac2TypeUrl,new Mac2KeyManager());
  registry.registerKeyManager(aeadTypeUrl,new AeadKeyManager());
  KeyManager<Mac,Message,Message> mac1Manager=registry.getKeyManager(mac1TypeUrl);
  KeyManager<Mac,Message,Message> mac2Manager=registry.getKeyManager(mac2TypeUrl);
  assertEquals(Mac1KeyManager.class,mac1Manager.getClass());
  assertEquals(Mac2KeyManager.class,mac2Manager.getClass());
  String computedMac=new String(mac1Manager.getPrimitive(ByteString.copyFrom(new byte[0])).computeMac(null));
  assertEquals(Mac1KeyManager.class.getSimpleName(),computedMac);
  computedMac=new String(mac2Manager.getPrimitive(ByteString.copyFrom(new byte[0])).computeMac(null));
  assertEquals(Mac2KeyManager.class.getSimpleName(),computedMac);
  KeyManager<Aead,Message,Message> aeadManager=registry.getKeyManager(aeadTypeUrl);
  assertEquals(AeadKeyManager.class,aeadManager.getClass());
  Aead aead=aeadManager.getPrimitive(ByteString.copyFrom(new byte[0]));
  String ciphertext=new String(aead.encrypt("String_Node_Str".getBytes(),null));
  assertEquals(AeadKeyManager.class.getSimpleName(),ciphertext);
  String badTypeUrl="String_Node_Str";
  try {
    KeyManager<Mac,Message,Message> macManager=registry.getKeyManager(badTypeUrl);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertTrue(e.toString().contains("String_Node_Str"));
    assertTrue(e.toString().contains(badTypeUrl));
  }
}

Fixed version (ground truth):
@Test public void testKeyManagerRegistration() throws Exception {
  Registry registry=new Registry();
  String mac1TypeUrl=Mac1KeyManager.class.getSimpleName();
  String mac2TypeUrl=Mac2KeyManager.class.getSimpleName();
  String aeadTypeUrl=AeadKeyManager.class.getSimpleName();
  registry.registerKeyManager(mac1TypeUrl,new Mac1KeyManager());
  registry.registerKeyManager(mac2TypeUrl,new Mac2KeyManager());
  registry.registerKeyManager(aeadTypeUrl,new AeadKeyManager());
  KeyManager<Mac,Message,Message> mac1Manager=registry.getKeyManager(mac1TypeUrl);
  KeyManager<Mac,Message,Message> mac2Manager=registry.getKeyManager(mac2TypeUrl);
  assertEquals(Mac1KeyManager.class,mac1Manager.getClass());
  assertEquals(Mac2KeyManager.class,mac2Manager.getClass());
  String computedMac=new String(mac1Manager.getPrimitive(ByteString.copyFrom(new byte[0])).computeMac(null));
  assertEquals(Mac1KeyManager.class.getSimpleName(),computedMac);
  computedMac=new String(mac2Manager.getPrimitive(ByteString.copyFrom(new byte[0])).computeMac(null));
  assertEquals(Mac2KeyManager.class.getSimpleName(),computedMac);
  KeyManager<Aead,Message,Message> aeadManager=registry.getKeyManager(aeadTypeUrl);
  assertEquals(AeadKeyManager.class,aeadManager.getClass());
  Aead aead=aeadManager.getPrimitive(ByteString.copyFrom(new byte[0]));
  String ciphertext=new String(aead.encrypt("String_Node_Str".getBytes("String_Node_Str"),null));
  assertEquals(AeadKeyManager.class.getSimpleName(),ciphertext);
  String badTypeUrl="String_Node_Str";
  try {
    KeyManager<Mac,Message,Message> unused=registry.getKeyManager(badTypeUrl);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertTrue(e.toString().contains("String_Node_Str"));
    assertTrue(e.toString().contains(badTypeUrl));
  }
}