Program: 5927
Project: 5927
Buggy source:
private void assertProgramSearch(Id.Application app) throws Exception {
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR2.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME2)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME3)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DS_WITH_SCHEMA_NAME)),new MetadataSearchResultRecord(myds)),searchMetadata(Id.Namespace.DEFAULT,"String_Node_Str"));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME)),new MetadataSearchResultRecord(Id.Program.from(Id.Application.from(Id.Namespace.DEFAULT,AppWithDataset.class.getSimpleName()),ProgramType.SERVICE,"String_Node_Str"))),searchMetadata(Id.Namespace.DEFAULT,"String_Node_Str"));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpFlow.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpMR.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpService.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpSpark.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpWorker.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpWorkflow.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.FLOW.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR2.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.MAPREDUCE.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME)),new MetadataSearchResultRecord(pingService)),searchMetadata(Id.Namespace.DEFAULT,ProgramType.SERVICE.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.SPARK.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.WORKER.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.WORKFLOW.getPrettyName(),MetadataSearchTargetType.PROGRAM));
}

Fixed version (ground truth):
private void assertProgramSearch(Id.Application app) throws Exception {
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR2.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME2)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME3)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME4)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME5)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME6)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DATASET_NAME7)),new MetadataSearchResultRecord(Id.DatasetInstance.from(Id.Namespace.DEFAULT,AllProgramsApp.DS_WITH_SCHEMA_NAME)),new MetadataSearchResultRecord(myds)),searchMetadata(Id.Namespace.DEFAULT,"String_Node_Str"));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME)),new MetadataSearchResultRecord(Id.Program.from(Id.Application.from(Id.Namespace.DEFAULT,AppWithDataset.class.getSimpleName()),ProgramType.SERVICE,"String_Node_Str"))),searchMetadata(Id.Namespace.DEFAULT,"String_Node_Str"));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpFlow.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpMR.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpService.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpSpark.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpWorker.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,AllProgramsApp.NoOpWorkflow.NAME,MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.FLOW,AllProgramsApp.NoOpFlow.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.FLOW.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR.NAME)),new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.MAPREDUCE,AllProgramsApp.NoOpMR2.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.MAPREDUCE.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SERVICE,AllProgramsApp.NoOpService.NAME)),new MetadataSearchResultRecord(pingService)),searchMetadata(Id.Namespace.DEFAULT,ProgramType.SERVICE.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.SPARK,AllProgramsApp.NoOpSpark.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.SPARK.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKER,AllProgramsApp.NoOpWorker.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.WORKER.getPrettyName(),MetadataSearchTargetType.PROGRAM));
  Assert.assertEquals(ImmutableSet.of(new MetadataSearchResultRecord(Id.Program.from(app,ProgramType.WORKFLOW,AllProgramsApp.NoOpWorkflow.NAME))),searchMetadata(Id.Namespace.DEFAULT,ProgramType.WORKFLOW.getPrettyName(),MetadataSearchTargetType.PROGRAM));
}