Program: 151518
Project: 151518
Buggy source:
@Test public void testHotSwap() throws Exception {
  AddonId dep1Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep2Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep3Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep4Id=AddonId.from("String_Node_Str","String_Node_Str");
  Addon dep1=registry.getAddon(dep1Id);
  Addon dep2=registry.getAddon(dep2Id);
  Addon dep3=registry.getAddon(dep3Id);
  Addon dep4=registry.getAddon(dep4Id);
  ClassLoader dep1Classloader=dep1.getClassLoader();
  ClassLoader dep2Classloader=dep2.getClassLoader();
  ClassLoader dep3Classloader=dep3.getClassLoader();
  ClassLoader dep4Classloader=dep4.getClassLoader();
  ((MutableAddonRepository)repository).disable(dep4Id);
  Addons.waitUntilStopped(dep1,10,TimeUnit.SECONDS);
  ((MutableAddonRepository)repository).enable(dep4Id);
  Addons.waitUntilStarted(dep1,10,TimeUnit.SECONDS);
  Assert.assertNotEquals(dep1Classloader,dep1.getClassLoader());
  Assert.assertNotEquals(dep1Classloader.toString(),dep1.getClassLoader().toString());
  Assert.assertNotEquals(dep2Classloader,dep2.getClassLoader());
  Assert.assertNotEquals(dep2Classloader.toString(),dep2.getClassLoader().toString());
  Assert.assertNotEquals(dep3Classloader,dep3.getClassLoader());
  Assert.assertNotEquals(dep3Classloader.toString(),dep3.getClassLoader().toString());
  Assert.assertNotEquals(dep4Classloader,dep4.getClassLoader());
  Assert.assertNotEquals(dep4Classloader.toString(),dep4.getClassLoader().toString());
  Assert.assertNotEquals(dep1Classloader,registry.getAddon(dep1Id).getClassLoader());
  Assert.assertNotEquals(dep1Classloader.toString(),registry.getAddon(dep1Id).getClassLoader().toString());
  Assert.assertNotEquals(dep2Classloader,registry.getAddon(dep2Id).getClassLoader());
  Assert.assertNotEquals(dep2Classloader.toString(),registry.getAddon(dep2Id).getClassLoader().toString());
  Assert.assertNotEquals(dep3Classloader,registry.getAddon(dep3Id).getClassLoader());
  Assert.assertNotEquals(dep3Classloader.toString(),registry.getAddon(dep3Id).getClassLoader().toString());
  Assert.assertNotEquals(dep4Classloader,registry.getAddon(dep4Id).getClassLoader());
  Assert.assertNotEquals(dep4Classloader.toString(),registry.getAddon(dep4Id).getClassLoader().toString());
}

Fixed version (ground truth):
@Test public void testHotSwap() throws Exception {
  AddonId dep1Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep2Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep3Id=AddonId.from("String_Node_Str","String_Node_Str");
  AddonId dep4Id=AddonId.from("String_Node_Str","String_Node_Str");
  Addon dep1=registry.getAddon(dep1Id);
  Addon dep2=registry.getAddon(dep2Id);
  Addon dep3=registry.getAddon(dep3Id);
  Addon dep4=registry.getAddon(dep4Id);
  ClassLoader dep1Classloader=dep1.getClassLoader();
  ClassLoader dep2Classloader=dep2.getClassLoader();
  ClassLoader dep3Classloader=dep3.getClassLoader();
  ClassLoader dep4Classloader=dep4.getClassLoader();
  Addons.waitUntilStarted(dep1,10,TimeUnit.SECONDS);
  Addons.waitUntilStarted(dep2,10,TimeUnit.SECONDS);
  Addons.waitUntilStarted(dep3,10,TimeUnit.SECONDS);
  Addons.waitUntilStarted(dep4,10,TimeUnit.SECONDS);
  ((MutableAddonRepository)repository).disable(dep4Id);
  Addons.waitUntilStopped(dep1,10,TimeUnit.SECONDS);
  ((MutableAddonRepository)repository).enable(dep4Id);
  Addons.waitUntilStarted(dep1,10,TimeUnit.SECONDS);
  Assert.assertNotEquals(dep1Classloader,dep1.getClassLoader());
  Assert.assertNotEquals(dep1Classloader.toString(),dep1.getClassLoader().toString());
  Assert.assertNotEquals(dep2Classloader,dep2.getClassLoader());
  Assert.assertNotEquals(dep2Classloader.toString(),dep2.getClassLoader().toString());
  Assert.assertNotEquals(dep3Classloader,dep3.getClassLoader());
  Assert.assertNotEquals(dep3Classloader.toString(),dep3.getClassLoader().toString());
  Assert.assertNotEquals(dep4Classloader,dep4.getClassLoader());
  Assert.assertNotEquals(dep4Classloader.toString(),dep4.getClassLoader().toString());
  Assert.assertNotEquals(dep1Classloader,registry.getAddon(dep1Id).getClassLoader());
  Assert.assertNotEquals(dep1Classloader.toString(),registry.getAddon(dep1Id).getClassLoader().toString());
  Assert.assertNotEquals(dep2Classloader,registry.getAddon(dep2Id).getClassLoader());
  Assert.assertNotEquals(dep2Classloader.toString(),registry.getAddon(dep2Id).getClassLoader().toString());
  Assert.assertNotEquals(dep3Classloader,registry.getAddon(dep3Id).getClassLoader());
  Assert.assertNotEquals(dep3Classloader.toString(),registry.getAddon(dep3Id).getClassLoader().toString());
  Assert.assertNotEquals(dep4Classloader,registry.getAddon(dep4Id).getClassLoader());
  Assert.assertNotEquals(dep4Classloader.toString(),registry.getAddon(dep4Id).getClassLoader().toString());
}