Program: 6319
Project: 6319
Buggy source:
@Test public void testSearchOnTags() throws Exception {
  Assert.assertEquals(0,dataset.getTags(app1).size());
  Assert.assertEquals(0,dataset.getTags(appNs2).size());
  Assert.assertEquals(0,dataset.getTags(flow1).size());
  Assert.assertEquals(0,dataset.getTags(dataset1).size());
  Assert.assertEquals(0,dataset.getTags(stream1).size());
  dataset.addTags(app1,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(appNs2,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(flow1,"String_Node_Str");
  dataset.addTags(dataset1,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(stream1,"String_Node_Str");
  List<MetadataEntry> results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(4,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(3,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.APP);
  Assert.assertEquals(1,results.size());
  dataset.removeTags(app1);
  dataset.removeTags(flow1);
  dataset.removeTags(dataset1);
  dataset.removeTags(stream1);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  Assert.assertEquals(0,dataset.getTags(app1).size());
  Assert.assertEquals(0,dataset.getTags(flow1).size());
  Assert.assertEquals(0,dataset.getTags(dataset1).size());
  Assert.assertEquals(0,dataset.getTags(stream1).size());
}

Fixed version (ground truth):
@Test public void testSearchOnTags() throws Exception {
  Assert.assertEquals(0,dataset.getTags(app1).size());
  Assert.assertEquals(0,dataset.getTags(appNs2).size());
  Assert.assertEquals(0,dataset.getTags(flow1).size());
  Assert.assertEquals(0,dataset.getTags(dataset1).size());
  Assert.assertEquals(0,dataset.getTags(stream1).size());
  dataset.addTags(app1,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(appNs2,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(flow1,"String_Node_Str");
  dataset.addTags(dataset1,"String_Node_Str","String_Node_Str","String_Node_Str");
  dataset.addTags(stream1,"String_Node_Str");
  List<MetadataEntry> results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(4,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(3,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.APP);
  Assert.assertEquals(1,results.size());
  dataset.removeTags(app1);
  dataset.removeTags(flow1);
  dataset.removeTags(dataset1);
  dataset.removeTags(stream1);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  Assert.assertEquals(0,dataset.getTags(app1).size());
  Assert.assertEquals(0,dataset.getTags(flow1).size());
  Assert.assertEquals(0,dataset.getTags(dataset1).size());
  Assert.assertEquals(0,dataset.getTags(stream1).size());
}