Program: 50239
Project: 50239
Buggy source:
@Test public void testAdjustStrandBias(){
  StrandBiasFilter adjuster1=new StrandBiasFilter(1);
  SampleCountInfo[] sampleCounts=makeTwoSampleCounts();
  sampleCounts[0].setGenotypeCount(SampleCountInfo.BASE_T_INDEX,1,true);
  sampleCounts[0].setGenotypeCount(SampleCountInfo.BASE_T_INDEX,1,false);
  sampleCounts[0].varCount++;
  assertEquals(5,sampleCounts[0].refCount);
  assertEquals(12,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6,sampleCounts[1].varCount);
  IntArrayList scores=IntArrayList.wrap(new int[]{10,20,30,40,40,40,40});
  final DiscoverVariantPositionData list=makeListWithScoresStranded(sampleCounts,scores);
  int index=0;
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 0) {
      element.matchesForwardStrand=(index++ % 2) == 1;
    }
  }
  assertEquals(33,list.size());
  ObjectSet<PositionBaseInfo> filteredList=new ObjectArraySet<PositionBaseInfo>();
  adjuster1.filterGenotypes(list,sampleCounts,filteredList);
  System.out.println("String_Node_Str" + list);
  System.out.println("String_Node_Str" + filteredList);
  boolean foundForward=false;
  boolean foundReverse=false;
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 0 && element.matchesForwardStrand) {
      foundForward=true;
    }
    if (element.to == 'T' && element.readerIndex == 0 && !element.matchesForwardStrand) {
      foundReverse=true;
    }
  }
  assertTrue(foundForward);
  assertTrue(foundReverse);
  CountFixer fixer=new CountFixer();
  fixer.fix(list,sampleCounts,filteredList);
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 1) {
      fail("String_Node_Str");
    }
    if (element.to == 'C') {
      fail("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Test public void testAdjustStrandBias(){
  StrandBiasFilter adjuster1=new StrandBiasFilter(1);
  SampleCountInfo[] sampleCounts=makeTwoSampleCounts();
  sampleCounts[0].setGenotypeCount(SampleCountInfo.BASE_T_INDEX,1,true);
  sampleCounts[0].setGenotypeCount(SampleCountInfo.BASE_T_INDEX,1,false);
  sampleCounts[0].varCount++;
  assertEquals(5,sampleCounts[0].refCount);
  assertEquals(12,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6,sampleCounts[1].varCount);
  IntArrayList scores=IntArrayList.wrap(new int[]{10,20,30,40,40,40,40});
  final DiscoverVariantPositionData list=makeListWithScoresStranded(sampleCounts,scores);
  int index=0;
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 0) {
      element.matchesForwardStrand=(index++ % 2) == 1;
    }
  }
  assertEquals(33,list.size());
  ObjectSet<PositionBaseInfo> filteredList=new ObjectArraySet<PositionBaseInfo>();
  adjuster1.filterGenotypes(list,sampleCounts,filteredList);
  System.out.println("String_Node_Str" + list);
  System.out.println("String_Node_Str" + filteredList);
  boolean foundForward=false;
  boolean foundReverse=false;
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 0 && element.matchesForwardStrand) {
      foundForward=true;
    }
    if (element.to == 'T' && element.readerIndex == 0 && !element.matchesForwardStrand) {
      foundReverse=true;
    }
  }
  assertTrue(foundForward);
  assertTrue(foundReverse);
  CountFixer fixer=new CountFixer();
  fixer.fix(list,sampleCounts,filteredList);
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",Arrays.toString(sampleCounts));
  for (  PositionBaseInfo element : list) {
    if (element.to == 'T' && element.readerIndex == 1) {
      fail("String_Node_Str");
    }
    if (element.to == 'C') {
      fail("String_Node_Str");
    }
  }
}