Program: 21369
Project: 21369
Buggy source:
void learnCajamarModel(DataStream<DataInstance> data){
  StaticVariables Vars=new StaticVariables(data.getAttributes());
  classVariable=Vars.getVariableById(Vars.getNumberOfVars() - 1);
  classVariable_PM=Vars.getVariableById(Vars.getNumberOfVars() - 2);
  TIME_ID=data.getAttributes().getAttributeByName("String_Node_Str");
  SEQUENCE_ID=data.getAttributes().getAttributeByName("String_Node_Str");
  int count=0;
  double averageAUC=0;
  Iterable<DataOnMemory<DataInstance>> iteratable=data.iterableOverBatches(NbrClients);
  Iterator<DataOnMemory<DataInstance>> iterator=iteratable.iterator();
  Queue<DataOnMemory<DataInstance>> monthsMinus12to0=new LinkedList<>();
  iterator.next();
  for (int i=0; i < 2; i++) {
    monthsMinus12to0.add(iterator.next());
  }
  while (iterator.hasNext()) {
    DataOnMemory<DataInstance> currentMonth=iterator.next();
    monthsMinus12to0.add(currentMonth);
    int idMonthMinus12=(int)monthsMinus12to0.peek().getDataInstance(0).getValue(TIME_ID);
    BayesianNetwork bn=null;
    if (isOnlyPrediction()) {
      DataOnMemory<DataInstance> batch=monthsMinus12to0.poll();
      StaticVariables vars=new StaticVariables(batch.getAttributes());
      bn=train(batch,vars,vars.getListOfVariables(),this.isDynamicNB());
      double auc=propagateAndTest(monthsMinus12to0,bn);
      System.out.println(idMonthMinus12 + "String_Node_Str" + auc);
      averageAUC+=auc;
    }
 else {
      bn=wrapperBNOneMonthNB(monthsMinus12to0.poll());
      double auc=propagateAndTest(monthsMinus12to0,bn);
      System.out.print(idMonthMinus12 + "String_Node_Str" + auc);
      bn.getDAG().getParentSets().stream().filter(p -> p.getNumberOfParents() > 0).forEach(p -> System.out.print("String_Node_Str" + p.getMainVar().getName()));
      System.out.println();
      averageAUC+=auc;
    }
    count+=NbrClients;
  }
  System.out.println("String_Node_Str" + averageAUC / (count / NbrClients));
}

Fixed version (ground truth):
void learnCajamarModel(DataStream<DataInstance> data){
  StaticVariables Vars=new StaticVariables(data.getAttributes());
  classVariable=Vars.getVariableById(Vars.getNumberOfVars() - 1);
  classVariable_PM=Vars.getVariableById(Vars.getNumberOfVars() - 2);
  TIME_ID=data.getAttributes().getAttributeByName("String_Node_Str");
  SEQUENCE_ID=data.getAttributes().getAttributeByName("String_Node_Str");
  int count=0;
  double averageAUC=0;
  Iterable<DataOnMemory<DataInstance>> iteratable=data.iterableOverBatches(NbrClients);
  Iterator<DataOnMemory<DataInstance>> iterator=iteratable.iterator();
  Queue<DataOnMemory<DataInstance>> monthsMinus12to0=new LinkedList<>();
  iterator.next();
  for (int i=0; i < 12; i++) {
    monthsMinus12to0.add(iterator.next());
  }
  while (iterator.hasNext()) {
    DataOnMemory<DataInstance> currentMonth=iterator.next();
    monthsMinus12to0.add(currentMonth);
    int idMonthMinus12=(int)monthsMinus12to0.peek().getDataInstance(0).getValue(TIME_ID);
    BayesianNetwork bn=null;
    if (isOnlyPrediction()) {
      DataOnMemory<DataInstance> batch=monthsMinus12to0.poll();
      StaticVariables vars=new StaticVariables(batch.getAttributes());
      bn=train(batch,vars,vars.getListOfVariables(),this.isDynamicNB());
      double auc=propagateAndTest(monthsMinus12to0,bn);
      System.out.println(idMonthMinus12 + "String_Node_Str" + auc);
      averageAUC+=auc;
    }
 else {
      bn=wrapperBNOneMonthNB(monthsMinus12to0.poll());
      double auc=propagateAndTest(monthsMinus12to0,bn);
      System.out.print(idMonthMinus12 + "String_Node_Str" + auc);
      bn.getDAG().getParentSets().stream().filter(p -> p.getNumberOfParents() > 0).forEach(p -> System.out.print("String_Node_Str" + p.getMainVar().getName()));
      System.out.println();
      averageAUC+=auc;
    }
    count+=NbrClients;
  }
  System.out.println("String_Node_Str" + averageAUC / (count / NbrClients));
}