Program: 63116
Project: 63116
Buggy source:
@Test public void testCubeCRUD() throws Exception {
  final int sleepTime=400;
  final Broadcaster broadcaster=Broadcaster.getInstance();
  broadcaster.getCounterAndClear();
  getStore().deleteResource("String_Node_Str");
  final String cubeName="String_Node_Str";
  final CubeManager cubeManager=getCubeManager(configA);
  final CubeManager cubeManagerB=getCubeManager(configB);
  final ProjectManager projectManager=getProjectManager(configA);
  final ProjectManager projectManagerB=getProjectManager(configB);
  final CubeDescManager cubeDescManager=getCubeDescManager(configA);
  final CubeDescManager cubeDescManagerB=getCubeDescManager(configB);
  final CubeDesc cubeDesc=getCubeDescManager(configA).getCubeDesc("String_Node_Str");
  assertTrue(cubeManager.getCube(cubeName) == null);
  assertTrue(cubeManagerB.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertTrue(!containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  cubeManager.createCube(cubeName,ProjectInstance.DEFAULT_PROJECT_NAME,cubeDesc,null);
  assertNotNull(cubeManager.getCube(cubeName));
  assertEquals(2,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertNotNull(cubeManagerB.getCube(cubeName));
  assertTrue(containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertTrue(containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  CubeInstance cube=cubeManager.getCube(cubeName);
  assertEquals(0,cube.getSegments().size());
  assertEquals(0,cubeManagerB.getCube(cubeName).getSegments().size());
  CubeSegment segment=new CubeSegment();
  segment.setName("String_Node_Str");
  cube.getSegments().add(segment);
  cubeManager.updateCube(cube);
  assertEquals(1,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertEquals(1,cubeManagerB.getCube(cubeName).getSegments().size());
  assertEquals(segment.getName(),cubeManagerB.getCube(cubeName).getSegments().get(0).getName());
  cubeManager.dropCube(cubeName,false);
  assertTrue(cubeManager.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertEquals(2,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertTrue(cubeManagerB.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  final String cubeDescName="String_Node_Str";
  cubeDesc.setName(cubeDescName);
  cubeDesc.setLastModified(0);
  assertTrue(cubeDescManager.getCubeDesc(cubeDescName) == null);
  assertTrue(cubeDescManagerB.getCubeDesc(cubeDescName) == null);
  cubeDescManager.createCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertNotNull(cubeDescManager.getCubeDesc(cubeDescName));
  assertNotNull(cubeDescManagerB.getCubeDesc(cubeDescName));
  cubeDesc.setNotifyList(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  cubeDescManager.updateCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertEquals(cubeDesc.getNotifyList(),cubeDescManagerB.getCubeDesc(cubeDescName).getNotifyList());
  cubeDescManager.removeCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  Thread.sleep(sleepTime);
  assertTrue(cubeDescManager.getCubeDesc(cubeDescName) == null);
  assertTrue(cubeDescManagerB.getCubeDesc(cubeDescName) == null);
  getStore().deleteResource("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCubeCRUD() throws Exception {
  final Broadcaster broadcaster=Broadcaster.getInstance();
  broadcaster.getCounterAndClear();
  getStore().deleteResource("String_Node_Str");
  final String cubeName="String_Node_Str";
  final CubeManager cubeManager=getCubeManager(configA);
  final CubeManager cubeManagerB=getCubeManager(configB);
  final ProjectManager projectManager=getProjectManager(configA);
  final ProjectManager projectManagerB=getProjectManager(configB);
  final CubeDescManager cubeDescManager=getCubeDescManager(configA);
  final CubeDescManager cubeDescManagerB=getCubeDescManager(configB);
  final CubeDesc cubeDesc=getCubeDescManager(configA).getCubeDesc("String_Node_Str");
  assertTrue(cubeManager.getCube(cubeName) == null);
  assertTrue(cubeManagerB.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertTrue(!containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  cubeManager.createCube(cubeName,ProjectInstance.DEFAULT_PROJECT_NAME,cubeDesc,null);
  assertNotNull(cubeManager.getCube(cubeName));
  assertEquals(2,broadcaster.getCounterAndClear());
  waitForCounterAndClear(2);
  assertNotNull(cubeManagerB.getCube(cubeName));
  assertTrue(containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertTrue(containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  CubeInstance cube=cubeManager.getCube(cubeName);
  assertEquals(0,cube.getSegments().size());
  assertEquals(0,cubeManagerB.getCube(cubeName).getSegments().size());
  CubeSegment segment=new CubeSegment();
  segment.setName("String_Node_Str");
  cube.getSegments().add(segment);
  cubeManager.updateCube(cube);
  assertEquals(1,broadcaster.getCounterAndClear());
  waitForCounterAndClear(1);
  assertEquals(1,cubeManagerB.getCube(cubeName).getSegments().size());
  assertEquals(segment.getName(),cubeManagerB.getCube(cubeName).getSegments().get(0).getName());
  cubeManager.dropCube(cubeName,false);
  assertTrue(cubeManager.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManager.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  assertEquals(2,broadcaster.getCounterAndClear());
  waitForCounterAndClear(2);
  assertTrue(cubeManagerB.getCube(cubeName) == null);
  assertTrue(!containsRealization(projectManagerB.listAllRealizations(ProjectInstance.DEFAULT_PROJECT_NAME),RealizationType.CUBE,cubeName));
  final String cubeDescName="String_Node_Str";
  cubeDesc.setName(cubeDescName);
  cubeDesc.setLastModified(0);
  assertTrue(cubeDescManager.getCubeDesc(cubeDescName) == null);
  assertTrue(cubeDescManagerB.getCubeDesc(cubeDescName) == null);
  cubeDescManager.createCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  waitForCounterAndClear(1);
  assertNotNull(cubeDescManager.getCubeDesc(cubeDescName));
  assertNotNull(cubeDescManagerB.getCubeDesc(cubeDescName));
  cubeDesc.setNotifyList(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  cubeDescManager.updateCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  waitForCounterAndClear(1);
  assertEquals(cubeDesc.getNotifyList(),cubeDescManagerB.getCubeDesc(cubeDescName).getNotifyList());
  cubeDescManager.removeCubeDesc(cubeDesc);
  assertEquals(1,broadcaster.getCounterAndClear());
  waitForCounterAndClear(1);
  assertTrue(cubeDescManager.getCubeDesc(cubeDescName) == null);
  assertTrue(cubeDescManagerB.getCubeDesc(cubeDescName) == null);
  getStore().deleteResource("String_Node_Str");
}