Program: 6692
Project: 6692
Buggy source:
@Test public void testSimpleLineage() throws Exception {
  LineageStore lineageStore=new LineageStore(getTxExecFactory(),dsFrameworkUtil.getFramework(),Id.DatasetInstance.from("String_Node_Str","String_Node_Str"));
  LineageService lineageService=new LineageService(lineageStore);
  MetadataRecord run1Meta=new MetadataRecord(program1,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str"));
  Set<MetadataRecord> run1data1=toSet(run1Meta,new MetadataRecord(dataset1,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str")));
  Set<MetadataRecord> run1data2=toSet(run1Meta,new MetadataRecord(dataset2,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str")));
  lineageStore.addAccess(run1,dataset1,AccessType.WRITE,run1data1,flowlet1);
  lineageStore.addAccess(run1,dataset2,AccessType.READ,run1data2,flowlet1);
  lineageStore.addAccess(run2,dataset2,AccessType.WRITE,EMPTY_METADATA,flowlet2);
  lineageStore.addAccess(run2,dataset3,AccessType.READ,EMPTY_METADATA,flowlet2);
  Lineage expectedLineage=new Lineage(ImmutableSet.of(new Relation(dataset1,program1,AccessType.WRITE,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program1,AccessType.READ,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program2,AccessType.WRITE,toSet(twillRunId(run2)),toSet(flowlet2)),new Relation(dataset3,program2,AccessType.READ,toSet(twillRunId(run2)),toSet(flowlet2))));
  Assert.assertEquals(expectedLineage,lineageService.computeLineage(dataset1,500,20000,100));
  Assert.assertEquals(expectedLineage,lineageService.computeLineage(dataset2,500,20000,100));
  Lineage oneLevelLineage=lineageService.computeLineage(dataset1,500,20000,1);
  Assert.assertEquals(ImmutableSet.of(new Relation(dataset1,program1,AccessType.WRITE,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program1,AccessType.READ,toSet(twillRunId(run1)),toSet(flowlet1))),oneLevelLineage.getRelations());
  Assert.assertEquals(toSet(run1data1,run1data2),lineageStore.getAccesses(run1));
}

Fixed version (ground truth):
@Test public void testSimpleLineage() throws Exception {
  LineageStore lineageStore=new LineageStore(getTxExecFactory(),dsFrameworkUtil.getFramework(),Id.DatasetInstance.from("String_Node_Str","String_Node_Str"));
  LineageService lineageService=new LineageService(lineageStore);
  MetadataRecord run1Meta=new MetadataRecord(program1,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str"));
  Set<MetadataRecord> run1data1=toSet(run1Meta,new MetadataRecord(dataset1,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str")));
  Set<MetadataRecord> run1data2=toSet(run1Meta,new MetadataRecord(dataset2,toMap("String_Node_Str","String_Node_Str"),toSet("String_Node_Str")));
  lineageStore.addAccess(run1,dataset1,AccessType.WRITE,run1data1,flowlet1);
  lineageStore.addAccess(run1,dataset2,AccessType.READ,run1data2,flowlet1);
  lineageStore.addAccess(run2,dataset2,AccessType.WRITE,EMPTY_METADATA,flowlet2);
  lineageStore.addAccess(run2,dataset3,AccessType.READ,EMPTY_METADATA,flowlet2);
  Lineage expectedLineage=new Lineage(ImmutableSet.of(new Relation(dataset1,program1,AccessType.WRITE,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program1,AccessType.READ,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program2,AccessType.WRITE,toSet(twillRunId(run2)),toSet(flowlet2)),new Relation(dataset3,program2,AccessType.READ,toSet(twillRunId(run2)),toSet(flowlet2))));
  Assert.assertEquals(expectedLineage,lineageService.computeLineage(dataset1,500,20000,100));
  Assert.assertEquals(expectedLineage,lineageService.computeLineage(dataset2,500,20000,100));
  Lineage oneLevelLineage=lineageService.computeLineage(dataset1,500,20000,1);
  Assert.assertEquals(ImmutableSet.of(new Relation(dataset1,program1,AccessType.WRITE,toSet(twillRunId(run1)),toSet(flowlet1)),new Relation(dataset2,program1,AccessType.READ,toSet(twillRunId(run1)),toSet(flowlet1))),oneLevelLineage.getRelations());
  Assert.assertEquals(toSet(run1data1,run1data2),lineageStore.getRunMetadata(run1));
}