Program: 17045
Project: 17045
Buggy source:
@Test public void testFilterDuplicateAFPsMinLenCTerm() throws PDBParseException, StructureException {
  int[][][] startAln, filteredAln;
  int ca2len;
  ca2len=10;
  startAln=new int[][][]{new int[][]{new int[]{0,1,2,3,4,5,6,7,8,9,10},new int[]{0,3,5,6,7,8,9,0 + ca2len,1 + ca2len,2 + ca2len,3 + ca2len}}};
  filteredAln=new int[][][]{new int[][]{new int[]{1,2,3,4,5,6},new int[]{3,5,6,7,8,9}},new int[][]{new int[]{7,8,9},new int[]{0,1,2}}};
  int[] filteredLen=new int[]{filteredAln[0][0].length,filteredAln[1][0].length};
  Atom[] ca1, ca2;
  AFPChain afpChain, result;
  ca1=makeDummyCA(startAln[0][0].length);
  ca2=makeDummyCA(ca2len);
  ca2=StructureTools.duplicateCA2(ca2);
  afpChain=makeDummyAFPChain(startAln,ca1,ca2);
  int minCPlength;
  for (minCPlength=0; minCPlength < 4; minCPlength++) {
    result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
    assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
    assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  }
  minCPlength=4;
  filteredAln=new int[][][]{new int[][]{new int[]{2,3,4,5,6},new int[]{5,6,7,8,9}},new int[][]{new int[]{7,8,9,10},new int[]{0,1,2,3}}};
  filteredLen=new int[]{filteredAln[0][0].length,filteredAln[1][0].length};
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  minCPlength=5;
  filteredAln=new int[][][]{new int[][]{new int[]{0,1,2,3,4,5,6},new int[]{0,3,5,6,7,8,9}}};
  filteredLen=new int[]{filteredAln[0][0].length};
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  minCPlength=7;
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
}

Fixed version (ground truth):
@Test public void testFilterDuplicateAFPsMinLenCTerm() throws PDBParseException, StructureException {
  int[][][] startAln, filteredAln;
  int[] filteredLen;
  int ca2len;
  ca2len=10;
  startAln=new int[][][]{new int[][]{new int[]{0,1,2,3,4,5,6,7,8,9,10},new int[]{0,3,5,6,7,8,9,0 + ca2len,1 + ca2len,2 + ca2len,3 + ca2len}}};
  Atom[] ca1, ca2;
  AFPChain afpChain, result;
  ca1=makeDummyCA(startAln[0][0].length);
  ca2=makeDummyCA(ca2len);
  ca2=StructureTools.duplicateCA2(ca2);
  afpChain=makeDummyAFPChain(startAln,ca1,ca2);
  filteredAln=new int[][][]{new int[][]{new int[]{1,2,3,4,5,6},new int[]{3,5,6,7,8,9}},new int[][]{new int[]{7,8,9},new int[]{0,1,2}}};
  filteredLen=new int[]{filteredAln[0][0].length,filteredAln[1][0].length};
  int minCPlength;
  for (minCPlength=0; minCPlength < 4; minCPlength++) {
    result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
    assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
    assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  }
  minCPlength=4;
  filteredAln=new int[][][]{new int[][]{new int[]{2,3,4,5,6},new int[]{5,6,7,8,9}},new int[][]{new int[]{7,8,9,10},new int[]{0,1,2,3}}};
  filteredLen=new int[]{filteredAln[0][0].length,filteredAln[1][0].length};
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  minCPlength=5;
  filteredAln=new int[][][]{new int[][]{new int[]{0,1,2,3,4,5,6},new int[]{0,3,5,6,7,8,9}}};
  filteredLen=new int[]{filteredAln[0][0].length};
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
  minCPlength=7;
  result=CeCPMain.filterDuplicateAFPs(afpChain,new CECalculator(null),ca1,ca2,minCPlength);
  assertTrue("String_Node_Str" + minCPlength,Arrays.deepEquals(filteredAln,result.getOptAln()));
  assertTrue("String_Node_Str" + minCPlength,Arrays.equals(filteredLen,result.getOptLen()));
}