Program: 132129
Project: 132129
Buggy source:
@Before public void before() throws ExecutionException, InterruptedException {
  DataBroker dataBroker=getDataBroker();
  opendaylightSfc.setDataProvider(dataBroker);
  executor=opendaylightSfc.getExecutor();
  int maxTries=10;
  ServiceFunctionType serviceFunctionType;
  List<SftServiceFunctionName> sftServiceFunctionNameList;
  boolean emptyFlag=true;
  while (maxTries > 0) {
    emptyFlag=true;
    executor.submit(SfcProviderServicePathAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceChainAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceTypeAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceFunctionAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceForwarderAPI.getDeleteAll(new Object[]{},new Class[]{}));
    Thread.sleep(1000);
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Firewall.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Dpi.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Napt44.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    maxTries--;
    if (emptyFlag) {
      break;
    }
  }
  LOG.debug("String_Node_Str",10 - maxTries,emptyFlag ? "String_Node_Str" : "String_Node_Str");
  String sfcName="String_Node_Str";
  List<SfcServiceFunction> sfcServiceFunctionList=new ArrayList<>();
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Firewall.class).build());
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Dpi.class).build());
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Napt44.class).build());
  sfChain=new ServiceFunctionChainBuilder().setName(sfcName).setKey(new ServiceFunctionChainKey(sfcName)).setSfcServiceFunction(sfcServiceFunctionList).build();
  ServiceFunctionPathBuilder serviceFunctionPathBuilder=new ServiceFunctionPathBuilder();
  serviceFunctionPathBuilder.setKey(new ServiceFunctionPathKey("String_Node_Str"));
  serviceFunctionPathBuilder.setPathId(1l);
  serviceFunctionPathBuilder.setServiceChainName(sfcName);
  List<ServicePathHop> sphs=new ArrayList<>();
  serviceFunctionPathBuilder.setServicePathHop(sphs);
  sfPath=serviceFunctionPathBuilder.build();
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),555),"String_Node_Str",VxlanGpe.class));
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),666),"String_Node_Str",VxlanGpe.class));
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),777),"String_Node_Str",VxlanGpe.class));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  ServiceFunctionsBuilder sfsBuilder=new ServiceFunctionsBuilder();
  sfsBuilder.setServiceFunction(sfList);
  executor.submit(SfcProviderServiceFunctionAPI.getPutAll(new Object[]{sfsBuilder.build()},new Class[]{ServiceFunctions.class})).get();
  Thread.sleep(1000);
  for (  ServiceFunction serviceFunction : sfList) {
    SfcProviderServiceTypeAPI.createServiceFunctionTypeEntryExecutor(serviceFunction);
  }
  Object[] sfcParameters={sfChain};
  Class[] sfcParameterTypes={ServiceFunctionChain.class};
  executor.submit(SfcProviderServiceChainAPI.getPut(sfcParameters,sfcParameterTypes)).get();
  Thread.sleep(1000);
}

Fixed version (ground truth):
@Before public void before() throws ExecutionException, InterruptedException, IllegalAccessException {
  DataBroker dataBroker=getDataBroker();
  opendaylightSfc.setDataProvider(dataBroker);
  executor=opendaylightSfc.getExecutor();
  int maxTries=10;
  ServiceFunctionType serviceFunctionType;
  List<SftServiceFunctionName> sftServiceFunctionNameList;
  boolean emptyFlag=true;
  while (maxTries > 0) {
    emptyFlag=true;
    executor.submit(SfcProviderServicePathAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceChainAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceTypeAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceFunctionAPI.getDeleteAll(new Object[]{},new Class[]{}));
    executor.submit(SfcProviderServiceForwarderAPI.getDeleteAll(new Object[]{},new Class[]{}));
    Thread.sleep(1000);
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Firewall.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Dpi.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    serviceFunctionType=SfcProviderServiceTypeAPI.readServiceFunctionTypeExecutor(Napt44.class);
    if (serviceFunctionType != null) {
      sftServiceFunctionNameList=serviceFunctionType.getSftServiceFunctionName();
      if (sftServiceFunctionNameList.size() != 0) {
        emptyFlag=false;
      }
    }
    maxTries--;
    if (emptyFlag) {
      break;
    }
  }
  Whitebox.getField(SfcServiceFunctionRoundRobinSchedulerAPI.class,"String_Node_Str").set(HashMap.class,new HashMap<>());
  LOG.debug("String_Node_Str",10 - maxTries,emptyFlag ? "String_Node_Str" : "String_Node_Str");
  String sfcName="String_Node_Str";
  List<SfcServiceFunction> sfcServiceFunctionList=new ArrayList<>();
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Firewall.class).build());
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Dpi.class).build());
  sfcServiceFunctionList.add(new SfcServiceFunctionBuilder().setName("String_Node_Str").setKey(new SfcServiceFunctionKey("String_Node_Str")).setType(Napt44.class).build());
  sfChain=new ServiceFunctionChainBuilder().setName(sfcName).setKey(new ServiceFunctionChainKey(sfcName)).setSfcServiceFunction(sfcServiceFunctionList).build();
  ServiceFunctionPathBuilder serviceFunctionPathBuilder=new ServiceFunctionPathBuilder();
  serviceFunctionPathBuilder.setKey(new ServiceFunctionPathKey("String_Node_Str"));
  serviceFunctionPathBuilder.setPathId(1l);
  serviceFunctionPathBuilder.setServiceChainName(sfcName);
  List<ServicePathHop> sphs=new ArrayList<>();
  serviceFunctionPathBuilder.setServicePathHop(sphs);
  sfPath=serviceFunctionPathBuilder.build();
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),555),"String_Node_Str",VxlanGpe.class));
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),666),"String_Node_Str",VxlanGpe.class));
  sfDPLList.add(SimpleTestEntityBuilder.buildSfDataPlaneLocator("String_Node_Str",SimpleTestEntityBuilder.buildLocatorTypeIp(new IpAddress(new Ipv4Address("String_Node_Str")),777),"String_Node_Str",VxlanGpe.class));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Firewall.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Dpi.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(0),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(1),Boolean.FALSE));
  sfList.add(SimpleTestEntityBuilder.buildServiceFunction("String_Node_Str",Napt44.class,new IpAddress(new Ipv4Address("String_Node_Str")),sfDPLList.get(2),Boolean.FALSE));
  ServiceFunctionsBuilder sfsBuilder=new ServiceFunctionsBuilder();
  sfsBuilder.setServiceFunction(sfList);
  executor.submit(SfcProviderServiceFunctionAPI.getPutAll(new Object[]{sfsBuilder.build()},new Class[]{ServiceFunctions.class})).get();
  Thread.sleep(1000);
  for (  ServiceFunction serviceFunction : sfList) {
    SfcProviderServiceTypeAPI.createServiceFunctionTypeEntryExecutor(serviceFunction);
  }
  Object[] sfcParameters={sfChain};
  Class[] sfcParameterTypes={ServiceFunctionChain.class};
  executor.submit(SfcProviderServiceChainAPI.getPut(sfcParameters,sfcParameterTypes)).get();
  Thread.sleep(1000);
}