Program: 6817
Project: 6817
Buggy source:
@Test public void testMapReduceUsage() throws Exception {
  final Id.Application app=Id.Application.from("String_Node_Str",AllProgramsApp.NAME);
  final Id.Program program=Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME);
  final Id.Stream stream=Id.Stream.from("String_Node_Str",AllProgramsApp.STREAM_NAME);
  final Id.DatasetInstance dataset=Id.DatasetInstance.from("String_Node_Str",AllProgramsApp.DATASET_NAME);
  Assert.assertEquals(0,getAppStreamUsage(app).size());
  Assert.assertEquals(0,getProgramStreamUsage(program).size());
  Assert.assertEquals(0,getStreamProgramUsage(stream).size());
  Assert.assertEquals(0,getAppDatasetUsage(app).size());
  Assert.assertEquals(0,getDatasetProgramUsage(dataset).size());
  deploy(AllProgramsApp.class);
  try {
    Assert.assertTrue(getAppStreamUsage(app).contains(stream));
    Assert.assertTrue(getProgramStreamUsage(program).contains(stream));
    Assert.assertTrue(getStreamProgramUsage(stream).contains(program));
    Assert.assertTrue(getProgramDatasetUsage(program).contains(dataset));
    Assert.assertTrue(getProgramDatasetUsage(program).contains(dataset));
    Assert.assertTrue(getAppDatasetUsage(app).contains(dataset));
    Assert.assertTrue(getDatasetProgramUsage(dataset).contains(program));
  }
  finally {
    deleteApp(app,200);
    Assert.assertEquals(0,getAppStreamUsage(app).size());
    Assert.assertEquals(0,getProgramStreamUsage(program).size());
    Assert.assertEquals(0,getStreamProgramUsage(stream).size());
    Assert.assertEquals(0,getAppDatasetUsage(app).size());
    Assert.assertEquals(0,getDatasetProgramUsage(dataset).size());
  }
}

Fixed version (ground truth):
@Test public void testMapReduceUsage() throws Exception {
  final Id.Application app=Id.Application.from("String_Node_Str",AllProgramsApp.NAME);
  final Id.Program program=Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME);
  final Id.Stream stream=Id.Stream.from("String_Node_Str",AllProgramsApp.STREAM_NAME);
  final Id.DatasetInstance dataset=Id.DatasetInstance.from("String_Node_Str",AllProgramsApp.DATASET_NAME);
  Assert.assertEquals(0,getAppStreamUsage(app).size());
  Assert.assertEquals(0,getProgramStreamUsage(program).size());
  Assert.assertEquals(0,getStreamProgramUsage(stream).size());
  Assert.assertEquals(0,getAppDatasetUsage(app).size());
  Assert.assertEquals(0,getDatasetProgramUsage(dataset).size());
  deploy(AllProgramsApp.class);
  try {
    Assert.assertTrue(getAppStreamUsage(app).contains(stream));
    Assert.assertTrue(getProgramStreamUsage(program).contains(stream));
    Assert.assertTrue(getStreamProgramUsage(stream).contains(program));
    Assert.assertTrue(getProgramDatasetUsage(program).contains(dataset));
    Assert.assertTrue(getAppDatasetUsage(app).contains(dataset));
    Assert.assertTrue(getDatasetProgramUsage(dataset).contains(program));
  }
  finally {
    deleteApp(app,200);
    Assert.assertEquals(0,getAppStreamUsage(app).size());
    Assert.assertEquals(0,getProgramStreamUsage(program).size());
    Assert.assertEquals(0,getStreamProgramUsage(stream).size());
    Assert.assertEquals(0,getAppDatasetUsage(app).size());
    Assert.assertEquals(0,getDatasetProgramUsage(dataset).size());
  }
}