Program: 50763
Project: 50763
Buggy source:
@Test public void testBuildGraph(){
  ServiceDefinition sd1=new ServiceDefinition();
  sd1.setInterface(INTERFACE1);
  OperationDefinition op1=new OperationDefinition();
  op1.setName(OP1);
  sd1.getOperations().add(op1);
  OperationImplDefinition stod1=new OperationImplDefinition();
  op1.getImplementations().add(stod1);
  RequestResponseDefinition rrd1=new RequestResponseDefinition();
  stod1.setRequestResponse(rrd1);
  InvocationDefinition id1=new InvocationDefinition();
  id1.setInterface(INTERFACE2);
  id1.setOperation(OP2);
  rrd1.getInvocations().add(id1);
  ServiceDefinition sd2=new ServiceDefinition();
  sd2.setInterface(INTERFACE2);
  OperationDefinition op2=new OperationDefinition();
  op2.setName(OP2);
  sd2.getOperations().add(op2);
  OperationImplDefinition stod2=new OperationImplDefinition();
  op2.getImplementations().add(stod2);
  RequestResponseDefinition rrd2=new RequestResponseDefinition();
  stod2.setRequestResponse(rrd2);
  InvocationDefinition id2a=new InvocationDefinition();
  id2a.setInterface(INTERFACE1);
  id2a.setOperation(OP1);
  rrd2.getInvocations().add(id2a);
  InvocationDefinition id2c=new InvocationDefinition();
  id2c.setInterface(INTERFACE3);
  id2c.setOperation(OP3);
  rrd2.getInvocations().add(id2c);
  RequestFaultDefinition rfd2=new RequestFaultDefinition();
  stod2.getRequestFaults().add(rfd2);
  InvocationDefinition id2b=new InvocationDefinition();
  id2b.setInterface(INTERFACE3);
  id2b.setOperation(OP3);
  rfd2.getInvocations().add(id2b);
  ServiceDefinition sd3=new ServiceDefinition();
  sd3.setInterface(INTERFACE3);
  OperationDefinition op3=new OperationDefinition();
  op3.setName(OP3);
  sd3.getOperations().add(op3);
  java.util.Set<ServiceDefinition> sds=new java.util.HashSet<ServiceDefinition>();
  sds.add(sd1);
  sds.add(sd2);
  sds.add(sd3);
  java.util.List<Situation> sits=new java.util.ArrayList<Situation>();
  Situation sit1=new Situation();
  sit1.setSeverity(Situation.Severity.Critical);
  sit1.setSubject(INTERFACE1);
  sit1.setType("String_Node_Str");
  sit1.setDescription("String_Node_Str");
  sits.add(sit1);
  Situation sit2=new Situation();
  sit2.setSeverity(Situation.Severity.High);
  sit2.setSubject(INTERFACE1);
  sit2.setType("String_Node_Str");
  sit2.setDescription("String_Node_Str");
  sits.add(sit2);
  Situation sit3=new Situation();
  sit3.setSeverity(Situation.Severity.High);
  sit3.setSubject(INTERFACE2 + "String_Node_Str" + OP2+ "String_Node_Str"+ SERVICE_TYPE2+ "String_Node_Str"+ FAULT2);
  sit3.setType("String_Node_Str");
  sit3.setDescription("String_Node_Str");
  sits.add(sit3);
  ServiceGraph result=ServiceDependencyBuilder.buildGraph(sds,sits);
  if (result == null) {
    fail("String_Node_Str");
  }
  if (result.getServiceNodes().size() != 3) {
    fail("String_Node_Str" + result.getServiceNodes().size());
  }
  if (result.getUsageLinks().size() != 3) {
    fail("String_Node_Str" + result.getUsageLinks().size());
  }
  if (result.getInvocationLinks().size() != 3) {
    fail("String_Node_Str" + result.getInvocationLinks().size());
  }
  ServiceNode sn1=result.getServiceNode(INTERFACE1);
  OperationNode opn1=sn1.getOperation(OP1);
  ServiceNode sn2=result.getServiceNode(INTERFACE2);
  OperationNode opn2=sn2.getOperation(OP2);
  ServiceNode sn3=result.getServiceNode(INTERFACE3);
  OperationNode opn3=sn3.getOperation(OP3);
  if (!result.getUsageLinks().contains(new UsageLink(sn1,sn2))) {
    fail("String_Node_Str");
  }
  if (!result.getUsageLinks().contains(new UsageLink(sn2,sn1))) {
    fail("String_Node_Str");
  }
  if (!result.getUsageLinks().contains(new UsageLink(sn2,sn3))) {
    fail("String_Node_Str");
  }
  if (result.getUsageLinks().contains(new UsageLink(sn3,sn2))) {
    fail("String_Node_Str");
  }
  int idcount=0;
  for (  UsageLink ul : result.getUsageLinks()) {
    idcount+=ul.getInvocations().size();
  }
  if (idcount != 4) {
    fail("String_Node_Str" + idcount);
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn1,opn2))) {
    fail("String_Node_Str");
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn2,opn1))) {
    fail("String_Node_Str");
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn2,opn3))) {
    fail("String_Node_Str");
  }
  if (result.getInvocationLinks().contains(new InvocationLink(opn3,opn2))) {
    fail("String_Node_Str");
  }
  idcount=0;
  for (  InvocationLink il : result.getInvocationLinks()) {
    idcount+=il.getInvocations().size();
  }
  if (idcount != 4) {
    fail("String_Node_Str" + idcount);
  }
  if (sn1.getSituations().size() != 2) {
    fail("String_Node_Str" + sn1.getSituations().size());
  }
  if (!sn1.getSituations().contains(sit1)) {
    fail("String_Node_Str");
  }
  if (!sn1.getSituations().contains(sit2)) {
    fail("String_Node_Str");
  }
  if (opn2.getSituations().size() != 1) {
    fail("String_Node_Str" + opn2.getSituations().size());
  }
  if (opn2.getSituations().get(0) != sit3) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testBuildGraph(){
  ServiceDefinition sd1=new ServiceDefinition();
  sd1.setInterface(INTERFACE1);
  OperationDefinition op1=new OperationDefinition();
  op1.setName(OP1);
  sd1.getOperations().add(op1);
  OperationImplDefinition stod1=new OperationImplDefinition();
  op1.getImplementations().add(stod1);
  RequestResponseDefinition rrd1=new RequestResponseDefinition();
  stod1.setRequestResponse(rrd1);
  InvocationDefinition id1=new InvocationDefinition();
  id1.setInterface(INTERFACE2);
  id1.setOperation(OP2);
  rrd1.getInvocations().add(id1);
  ServiceDefinition sd2=new ServiceDefinition();
  sd2.setInterface(INTERFACE2);
  OperationDefinition op2=new OperationDefinition();
  op2.setName(OP2);
  sd2.getOperations().add(op2);
  OperationImplDefinition stod2=new OperationImplDefinition();
  op2.getImplementations().add(stod2);
  RequestResponseDefinition rrd2=new RequestResponseDefinition();
  stod2.setRequestResponse(rrd2);
  InvocationDefinition id2a=new InvocationDefinition();
  id2a.setInterface(INTERFACE1);
  id2a.setOperation(OP1);
  rrd2.getInvocations().add(id2a);
  InvocationDefinition id2c=new InvocationDefinition();
  id2c.setInterface(INTERFACE3);
  id2c.setOperation(OP3);
  rrd2.getInvocations().add(id2c);
  RequestFaultDefinition rfd2=new RequestFaultDefinition();
  stod2.getRequestFaults().add(rfd2);
  InvocationDefinition id2b=new InvocationDefinition();
  id2b.setInterface(INTERFACE3);
  id2b.setOperation(OP3);
  rfd2.getInvocations().add(id2b);
  ServiceDefinition sd3=new ServiceDefinition();
  sd3.setInterface(INTERFACE3);
  OperationDefinition op3=new OperationDefinition();
  op3.setName(OP3);
  sd3.getOperations().add(op3);
  java.util.Set<ServiceDefinition> sds=new java.util.HashSet<ServiceDefinition>();
  sds.add(sd1);
  sds.add(sd2);
  sds.add(sd3);
  java.util.List<Situation> sits=new java.util.ArrayList<Situation>();
  Situation sit1=new Situation();
  sit1.setSeverity(Situation.Severity.Critical);
  sit1.setSubject(Situation.createSubject(INTERFACE1));
  sit1.setType("String_Node_Str");
  sit1.setDescription("String_Node_Str");
  sits.add(sit1);
  Situation sit2=new Situation();
  sit2.setSeverity(Situation.Severity.High);
  sit2.setSubject(Situation.createSubject(INTERFACE1));
  sit2.setType("String_Node_Str");
  sit2.setDescription("String_Node_Str");
  sits.add(sit2);
  Situation sit3=new Situation();
  sit3.setSeverity(Situation.Severity.High);
  sit3.setSubject(Situation.createSubject(INTERFACE2,OP2,SERVICE_TYPE2,FAULT2));
  sit3.setType("String_Node_Str");
  sit3.setDescription("String_Node_Str");
  sits.add(sit3);
  ServiceGraph result=ServiceDependencyBuilder.buildGraph(sds,sits);
  if (result == null) {
    fail("String_Node_Str");
  }
  if (result.getServiceNodes().size() != 3) {
    fail("String_Node_Str" + result.getServiceNodes().size());
  }
  if (result.getUsageLinks().size() != 3) {
    fail("String_Node_Str" + result.getUsageLinks().size());
  }
  if (result.getInvocationLinks().size() != 3) {
    fail("String_Node_Str" + result.getInvocationLinks().size());
  }
  ServiceNode sn1=result.getServiceNode(INTERFACE1);
  OperationNode opn1=sn1.getOperation(OP1);
  ServiceNode sn2=result.getServiceNode(INTERFACE2);
  OperationNode opn2=sn2.getOperation(OP2);
  ServiceNode sn3=result.getServiceNode(INTERFACE3);
  OperationNode opn3=sn3.getOperation(OP3);
  if (!result.getUsageLinks().contains(new UsageLink(sn1,sn2))) {
    fail("String_Node_Str");
  }
  if (!result.getUsageLinks().contains(new UsageLink(sn2,sn1))) {
    fail("String_Node_Str");
  }
  if (!result.getUsageLinks().contains(new UsageLink(sn2,sn3))) {
    fail("String_Node_Str");
  }
  if (result.getUsageLinks().contains(new UsageLink(sn3,sn2))) {
    fail("String_Node_Str");
  }
  int idcount=0;
  for (  UsageLink ul : result.getUsageLinks()) {
    idcount+=ul.getInvocations().size();
  }
  if (idcount != 4) {
    fail("String_Node_Str" + idcount);
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn1,opn2))) {
    fail("String_Node_Str");
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn2,opn1))) {
    fail("String_Node_Str");
  }
  if (!result.getInvocationLinks().contains(new InvocationLink(opn2,opn3))) {
    fail("String_Node_Str");
  }
  if (result.getInvocationLinks().contains(new InvocationLink(opn3,opn2))) {
    fail("String_Node_Str");
  }
  idcount=0;
  for (  InvocationLink il : result.getInvocationLinks()) {
    idcount+=il.getInvocations().size();
  }
  if (idcount != 4) {
    fail("String_Node_Str" + idcount);
  }
  if (sn1.getSituations().size() != 2) {
    fail("String_Node_Str" + sn1.getSituations().size());
  }
  if (!sn1.getSituations().contains(sit1)) {
    fail("String_Node_Str");
  }
  if (!sn1.getSituations().contains(sit2)) {
    fail("String_Node_Str");
  }
  if (sn2.getSituations().size() != 0) {
    fail("String_Node_Str" + sn2.getSituations().size());
  }
  if (opn2.getSituations().size() != 1) {
    fail("String_Node_Str" + opn2.getSituations().size());
  }
  if (opn2.getSituations().get(0) != sit3) {
    fail("String_Node_Str");
  }
}