Program: 16370
Project: 16370
Buggy source:
@Test public void testOpenCase(){
  SymmetryAxes axes=new SymmetryAxes();
  Matrix4d t10=new Matrix4d();
  t10.set(1,new Vector3d(-10,0,0));
  axes.addAxis(t10,4,SymmetryType.OPEN);
  Matrix4d r180=new Matrix4d();
  r180.set(new AxisAngle4d(1,0,0,Math.PI));
  axes.addAxis(r180,2,SymmetryType.CLOSED);
  assertEquals(2,axes.getElementaryAxes().size());
  Matrix4d expectedEven=new Matrix4d();
  expectedEven.set(1);
  Matrix4d expectedOdd=new Matrix4d(r180);
  assertEquals(expectedEven,axes.getRepeatTransform(0));
  assertEquals(expectedOdd,axes.getRepeatTransform(1));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(2));
  assertEquals(expectedOdd,axes.getRepeatTransform(3));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(4));
  assertEquals(expectedOdd,axes.getRepeatTransform(5));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(6));
  assertEquals(expectedOdd,axes.getRepeatTransform(7));
  List<List<Integer>> relation=Arrays.asList(Arrays.asList(0,1,2,3,4,5),Arrays.asList(2,3,4,5,6,7));
  assertEquals(relation,axes.getRepeatRelation(0));
  relation=Arrays.asList(Arrays.asList(0,1),Arrays.asList(1,0));
  assertEquals(relation,axes.getRepeatRelation(1));
  try {
    axes.getRepeatRelation(2);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  relation=Arrays.asList(Arrays.asList(0,2,4,6),Arrays.asList(1,3,5,7));
  assertEquals(relation,axes.getRepeatsCyclicForm(0));
  relation=Arrays.asList(Arrays.asList(0,1));
  assertEquals(relation,axes.getRepeatsCyclicForm(1));
  relation=Arrays.asList(Arrays.asList(2,3));
  assertEquals(relation,axes.getRepeatsCyclicForm(1,2));
  try {
    axes.getRepeatsCyclicForm(2);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  try {
    axes.getRepeatsCyclicForm(1,1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Point3d[] repeats=new Point3d[]{new Point3d(-15,1,1),new Point3d(-15,-1,-1),new Point3d(-5,1,1),new Point3d(-5,-1,-1),new Point3d(5,1,1),new Point3d(5,-1,-1),new Point3d(15,1,1),new Point3d(15,-1,-1)};
  for (int i=0; i < 8; i++) {
    Matrix4d m=axes.getRepeatTransform(i);
    m.invert();
    Point3d x=new Point3d(repeats[0]);
    m.transform(x);
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ repeats[0]+ "String_Node_Str"+ x+ "String_Node_Str"+ repeats[i],x.epsilonEquals(repeats[i],1e-5));
  }
  for (int i=0; i < 8; i++) {
    Matrix4d m=axes.getRepeatTransform(i);
    Point3d x=new Point3d(repeats[i]);
    m.transform(x);
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ repeats[i]+ "String_Node_Str"+ x+ "String_Node_Str"+ repeats[0],x.epsilonEquals(repeats[0],1e-5));
  }
  Point3d x;
  List<Axis> symmetryAxes=axes.getSymmetryAxes();
  assertEquals(5,symmetryAxes.size());
  int axisNum=0;
  x=new Point3d(repeats[2]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[2]),round(x),round(repeats[0])),x.epsilonEquals(repeats[0],1e-5));
  axisNum++;
  x=new Point3d(repeats[1]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[1]),round(x),round(repeats[0])),x.epsilonEquals(repeats[0],1e-5));
  axisNum++;
  x=new Point3d(repeats[3]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[3]),round(x),round(repeats[2])),x.epsilonEquals(repeats[2],1e-5));
  axisNum++;
  x=new Point3d(repeats[5]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[5]),round(x),round(repeats[4])),x.epsilonEquals(repeats[4],1e-5));
  axisNum++;
  x=new Point3d(repeats[7]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[7]),round(x),round(repeats[6])),x.epsilonEquals(repeats[6],1e-5));
  axisNum++;
}

Fixed version (ground truth):
@Test public void testOpenCase(){
  SymmetryAxes axes=new SymmetryAxes();
  Matrix4d t10=new Matrix4d();
  t10.set(1,new Vector3d(-10,0,0));
  axes.addAxis(t10,4,SymmetryType.OPEN);
  Matrix4d r180=new Matrix4d();
  r180.set(new AxisAngle4d(1,0,0,Math.PI));
  axes.addAxis(r180,2,SymmetryType.CLOSED);
  assertEquals(2,axes.getElementaryAxes().size());
  Matrix4d expectedEven=new Matrix4d();
  expectedEven.setIdentity();
  Matrix4d expectedOdd=new Matrix4d(r180);
  assertEquals(expectedEven,axes.getRepeatTransform(0));
  assertEquals(expectedOdd,axes.getRepeatTransform(1));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(2));
  assertEquals(expectedOdd,axes.getRepeatTransform(3));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(4));
  assertEquals(expectedOdd,axes.getRepeatTransform(5));
  expectedEven.mul(t10);
  expectedOdd.mul(r180,expectedEven);
  assertEquals(expectedEven,axes.getRepeatTransform(6));
  assertEquals(expectedOdd,axes.getRepeatTransform(7));
  List<List<Integer>> relation=Arrays.asList(Arrays.asList(0,1,2,3,4,5),Arrays.asList(2,3,4,5,6,7));
  assertEquals(relation,axes.getRepeatRelation(0));
  relation=Arrays.asList(Arrays.asList(0,1),Arrays.asList(1,0));
  assertEquals(relation,axes.getRepeatRelation(1));
  try {
    axes.getRepeatRelation(2);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  relation=Arrays.asList(Arrays.asList(0,2,4,6),Arrays.asList(1,3,5,7));
  assertEquals(relation,axes.getRepeatsCyclicForm(0));
  relation=Arrays.asList(Arrays.asList(0,1));
  assertEquals(relation,axes.getRepeatsCyclicForm(1));
  relation=Arrays.asList(Arrays.asList(2,3));
  assertEquals(relation,axes.getRepeatsCyclicForm(1,2));
  try {
    axes.getRepeatsCyclicForm(2);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  try {
    axes.getRepeatsCyclicForm(1,1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Point3d[] repeats=new Point3d[]{new Point3d(-15,1,1),new Point3d(-15,-1,-1),new Point3d(-5,1,1),new Point3d(-5,-1,-1),new Point3d(5,1,1),new Point3d(5,-1,-1),new Point3d(15,1,1),new Point3d(15,-1,-1)};
  for (int i=0; i < 8; i++) {
    Matrix4d m=axes.getRepeatTransform(i);
    m.invert();
    Point3d x=new Point3d(repeats[0]);
    m.transform(x);
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ repeats[0]+ "String_Node_Str"+ x+ "String_Node_Str"+ repeats[i],x.epsilonEquals(repeats[i],1e-5));
  }
  for (int i=0; i < 8; i++) {
    Matrix4d m=axes.getRepeatTransform(i);
    Point3d x=new Point3d(repeats[i]);
    m.transform(x);
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ repeats[i]+ "String_Node_Str"+ x+ "String_Node_Str"+ repeats[0],x.epsilonEquals(repeats[0],1e-5));
  }
  Point3d x;
  List<Axis> symmetryAxes=axes.getSymmetryAxes();
  assertEquals(5,symmetryAxes.size());
  int axisNum=0;
  x=new Point3d(repeats[2]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[2]),round(x),round(repeats[0])),x.epsilonEquals(repeats[0],1e-5));
  axisNum++;
  x=new Point3d(repeats[1]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[1]),round(x),round(repeats[0])),x.epsilonEquals(repeats[0],1e-5));
  axisNum++;
  x=new Point3d(repeats[3]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[3]),round(x),round(repeats[2])),x.epsilonEquals(repeats[2],1e-5));
  axisNum++;
  x=new Point3d(repeats[5]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[5]),round(x),round(repeats[4])),x.epsilonEquals(repeats[4],1e-5));
  axisNum++;
  x=new Point3d(repeats[7]);
  symmetryAxes.get(axisNum).getOperator().transform(x);
  assertTrue(String.format("String_Node_Str",axisNum,round(repeats[7]),round(x),round(repeats[6])),x.epsilonEquals(repeats[6],1e-5));
  axisNum++;
}