Program: 144018
Project: 144018
Buggy source:
@Test public void testEndToEnd(){
  String experimentName="String_Node_Str";
  for (  ProbabilisticSoftLogicProblem.GroundingMode groundingMode : ProbabilisticSoftLogicProblem.GroundingMode.values()) {
    if (groundingMode != ProbabilisticSoftLogicProblem.GroundingMode.NewAllPossible) {
      continue;
    }
    String outputStreamName=null;
    try {
      Path knowsPath=Paths.get(this.getClass().getResource("String_Node_Str" + experimentName + "String_Node_Str").toURI());
      outputStreamName=Paths.get(knowsPath.getParent().toString(),"String_Node_Str").toString();
    }
 catch (    URISyntaxException e) {
      fail(e.getMessage());
      System.out.println(e.getMessage());
      e.printStackTrace();
      return;
    }
    File outputStreamFile=new File(outputStreamName);
    ProbabilisticSoftLogicProblem.Builder problemBuilder=null;
    ProbabilisticSoftLogicPredicateManager trainPredicateManager=null;
    LogicManager<Integer,Double> logicManager=new LogicManager<>(new LukasiewiczLogic());
    VariableType<Integer> personType=logicManager.addVariableType("String_Node_Str",Integer.class);
    List<Integer> personValues=Arrays.asList(ArrayUtils.toObject(new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}));
    logicManager.addVariable("String_Node_Str",personValues,personType);
    logicManager.addVariable("String_Node_Str",personValues,personType);
    logicManager.addVariable("String_Node_Str",personValues,personType);
    logicManager.addVariable("String_Node_Str",personValues,personType);
    if (false) {
      try (FileInputStream inputStream=new FileInputStream(outputStreamFile)){
        Map.Entry<ProbabilisticSoftLogicPredicateManager,ProbabilisticSoftLogicProblem.Builder> deserialized=ProbabilisticSoftLogicProblem.ProblemSerializer.read(inputStream);
        trainPredicateManager=deserialized.getKey();
        problemBuilder=deserialized.getValue();
      }
 catch (      IOException|ClassNotFoundException e) {
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
    }
 else {
      InputStream groundingStream=null;
      if (groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AsRead) {
        groundingStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      }
      InputStream modelStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream knowsStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream trustTrainStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream trustTestStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      List<ProbabilisticSoftLogicProblem.Rule> rules=null;
      trainPredicateManager=new ProbabilisticSoftLogicPredicateManager();
      ProbabilisticSoftLogicPredicateManager testPredicateManager=new ProbabilisticSoftLogicPredicateManager();
      try (BufferedReader groundingReader=groundingStream == null ? null : new BufferedReader(new InputStreamReader(groundingStream));BufferedReader modelReader=new BufferedReader(new InputStreamReader(modelStream));BufferedReader knowsReader=new BufferedReader(new InputStreamReader(knowsStream));BufferedReader trustTrainReader=new BufferedReader(new InputStreamReader(trustTrainStream));BufferedReader trustTestReader=trustTestStream == null ? null : new BufferedReader(new InputStreamReader(trustTestStream))){
        rules=ProbabilisticSoftLogicReader.readRules(modelReader);
        List<VariableType<Integer>> argumentTypes=new ArrayList<>(2);
        argumentTypes.add(personType);
        argumentTypes.add(personType);
        logicManager.addPredicate("String_Node_Str",argumentTypes,false);
        logicManager.addPredicate("String_Node_Str",argumentTypes,false);
        ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AllPossible,false,knowsReader);
        ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",false,false,trustTrainReader);
        if (groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AsRead) {
          ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",false,true,groundingReader);
        }
        ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(testPredicateManager,logicManager,personType,"String_Node_Str",false,false,trustTestReader);
      }
 catch (      IOException|DataFormatException e) {
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
      FileOutputStream outputStream=null;
      try {
        outputStream=new FileOutputStream(outputStreamFile);
        problemBuilder=ProbabilisticSoftLogicProblem.ProblemSerializer.write(outputStream,rules,trainPredicateManager,logicManager,personType,groundingMode);
        outputStream.close();
      }
 catch (      Exception e) {
        if (outputStream != null) {
          try {
            outputStream.close();
          }
 catch (          IOException e2) {
          }
          outputStreamFile.delete();
        }
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
    }
    ProbabilisticSoftLogicProblem problem=problemBuilder.build();
    Map<Integer,Double> result=problem.solve();
    Map<String,Double> filteredResults=new HashMap<>();
    ProbabilisticSoftLogicPredicateManager temp=trainPredicateManager;
    result.keySet().stream().filter(key -> result.get(key) > Math.sqrt(Double.MIN_VALUE)).forEach(key -> filteredResults.put(temp.getPredicateFromId(key).toString(),result.get(key)));
    System.out.println(result.get(0));
    System.out.println(result.get(1));
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testEndToEnd(){
  String experimentName="String_Node_Str";
  for (  ProbabilisticSoftLogicProblem.GroundingMode groundingMode : ProbabilisticSoftLogicProblem.GroundingMode.values()) {
    if (groundingMode != ProbabilisticSoftLogicProblem.GroundingMode.NewAllPossible) {
      continue;
    }
    String outputStreamName=null;
    try {
      Path knowsPath=Paths.get(this.getClass().getResource("String_Node_Str" + experimentName + "String_Node_Str").toURI());
      outputStreamName=Paths.get(knowsPath.getParent().toString(),"String_Node_Str").toString();
    }
 catch (    URISyntaxException e) {
      fail(e.getMessage());
      System.out.println(e.getMessage());
      e.printStackTrace();
      return;
    }
    File outputStreamFile=new File(outputStreamName);
    ProbabilisticSoftLogicProblem.Builder problemBuilder=null;
    ProbabilisticSoftLogicPredicateManager trainPredicateManager=null;
    LogicManager<Integer,Double> logicManager=new LogicManager<>(new LukasiewiczLogic());
    VariableType<Integer> personType=logicManager.addVariableType("String_Node_Str",Integer.class);
    Set<Integer> personValues=new HashSet<>();
    try {
      Stream<String> lines=Files.lines(Paths.get(LogicRuleParserTest.class.getResource("String_Node_Str" + experimentName + "String_Node_Str").getPath()));
      lines.forEach(line -> {
        String[] lineParts=line.split("String_Node_Str");
        for (        String linePart : lineParts)         personValues.add(Integer.parseInt(linePart.trim()));
      }
);
      lines=Files.lines(Paths.get(LogicRuleParserTest.class.getResource("String_Node_Str" + experimentName + "String_Node_Str").getPath()));
      lines.forEach(line -> {
        String[] lineParts=line.split("String_Node_Str");
        for (int partIndex=0; partIndex < lineParts.length - 1; partIndex++)         personValues.add(Integer.parseInt(lineParts[partIndex].trim()));
      }
);
    }
 catch (    IOException ignored) {
    }
    logicManager.addVariable("String_Node_Str",new ArrayList<Integer>(personValues),personType);
    logicManager.addVariable("String_Node_Str",new ArrayList<Integer>(personValues),personType);
    logicManager.addVariable("String_Node_Str",new ArrayList<Integer>(personValues),personType);
    logicManager.addVariable("String_Node_Str",new ArrayList<Integer>(personValues),personType);
    if (false) {
      try (FileInputStream inputStream=new FileInputStream(outputStreamFile)){
        Map.Entry<ProbabilisticSoftLogicPredicateManager,ProbabilisticSoftLogicProblem.Builder> deserialized=ProbabilisticSoftLogicProblem.ProblemSerializer.read(inputStream);
        trainPredicateManager=deserialized.getKey();
        problemBuilder=deserialized.getValue();
      }
 catch (      IOException|ClassNotFoundException e) {
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
    }
 else {
      InputStream groundingStream=null;
      if (groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AsRead) {
        groundingStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      }
      InputStream modelStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream knowsStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream trustTrainStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      InputStream trustTestStream=LogicRuleParserTest.class.getResourceAsStream("String_Node_Str" + experimentName + "String_Node_Str");
      List<ProbabilisticSoftLogicProblem.Rule> rules=null;
      trainPredicateManager=new ProbabilisticSoftLogicPredicateManager();
      ProbabilisticSoftLogicPredicateManager testPredicateManager=new ProbabilisticSoftLogicPredicateManager();
      try (BufferedReader groundingReader=groundingStream == null ? null : new BufferedReader(new InputStreamReader(groundingStream));BufferedReader modelReader=new BufferedReader(new InputStreamReader(modelStream));BufferedReader knowsReader=new BufferedReader(new InputStreamReader(knowsStream));BufferedReader trustTrainReader=new BufferedReader(new InputStreamReader(trustTrainStream));BufferedReader trustTestReader=trustTestStream == null ? null : new BufferedReader(new InputStreamReader(trustTestStream))){
        rules=ProbabilisticSoftLogicReader.readRules(modelReader);
        List<VariableType<Integer>> argumentTypes=new ArrayList<>(2);
        argumentTypes.add(personType);
        argumentTypes.add(personType);
        logicManager.addPredicate("String_Node_Str",argumentTypes,false);
        logicManager.addPredicate("String_Node_Str",argumentTypes,false);
        ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AllPossible,false,knowsReader);
        ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",false,false,trustTrainReader);
        if (groundingMode == ProbabilisticSoftLogicProblem.GroundingMode.AsRead) {
          ProbabilisticSoftLogicReader.readGroundingsAndAddToManager(trainPredicateManager,logicManager,personType,"String_Node_Str",false,true,groundingReader);
        }
      }
 catch (      IOException|DataFormatException e) {
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
      FileOutputStream outputStream=null;
      try {
        outputStream=new FileOutputStream(outputStreamFile);
        problemBuilder=ProbabilisticSoftLogicProblem.ProblemSerializer.write(outputStream,rules,trainPredicateManager,logicManager,personType,groundingMode);
        outputStream.close();
      }
 catch (      Exception e) {
        if (outputStream != null) {
          try {
            outputStream.close();
          }
 catch (          IOException e2) {
          }
          outputStreamFile.delete();
        }
        fail(e.getMessage());
        System.out.println(e.getMessage());
        e.printStackTrace();
      }
    }
    ProbabilisticSoftLogicProblem problem=problemBuilder.build();
    Map<Integer,Double> result=problem.solve();
    Map<String,Double> filteredResults=new HashMap<>();
    ProbabilisticSoftLogicPredicateManager temp=trainPredicateManager;
    result.keySet().stream().filter(key -> result.get(key) > Math.sqrt(Double.MIN_VALUE)).forEach(key -> filteredResults.put(temp.getPredicateFromId(key).toString(),result.get(key)));
    System.out.println(result.get(0));
    System.out.println(result.get(1));
    System.out.println("String_Node_Str");
  }
}