Program: 86557
Project: 86557
Buggy source:
public void testRevertInsertionInTriangle() throws DelaunayError {
  ConstrainedMesh mesh=new ConstrainedMesh();
  DPoint pt1=new DPoint(0,0,0);
  mesh.addPoint(pt1);
  DPoint pt2=new DPoint(6,0,0);
  mesh.addPoint(pt2);
  DPoint pt3=new DPoint(3,5,0);
  mesh.addPoint(pt3);
  mesh.processDelaunay();
  DTriangle tri=mesh.getTriangleList().get(0);
  DEdge e1=mesh.getEdges().get(0);
  DEdge e2=mesh.getEdges().get(1);
  DEdge e3=mesh.getEdges().get(2);
  mesh.initPointInTriangle(new DPoint(3,2,0),tri,new LinkedList<DEdge>());
  DPoint pt;
  if (!tri.belongsTo(pt1)) {
    pt=pt1;
  }
 else   if (!tri.belongsTo(pt2)) {
    pt=pt2;
  }
 else {
    pt=pt3;
  }
  mesh.revertPointInTriangleInsertion(tri,new DPoint(3,2,0),pt);
  List<DTriangle> tris=mesh.getTriangleList();
  assertTrue(tris.size() == 1);
  assertEquals(new DTriangle(new DEdge(0,0,0,6,0,0),new DEdge(6,0,0,3,5,0),new DEdge(3,5,0,0,0,0)),tris.get(0));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(6,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,5,0)));
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,6,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(3,5,0,6,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,5,0)));
  assertTrue(mesh.getPoints().get(0) == pt1);
  assertTrue(mesh.getPoints().get(1) == pt3);
  assertTrue(mesh.getPoints().get(2) == pt2);
  assertCoherence(mesh);
  DTriangle dt=mesh.getTriangleList().get(0);
  DEdge ed=dt.getEdge(0);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
  ed=dt.getEdge(2);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
  ed=dt.getEdge(1);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
}

Fixed version (ground truth):
public void testRevertInsertionInTriangle() throws DelaunayError {
  ConstrainedMesh mesh=new ConstrainedMesh();
  DPoint pt1=new DPoint(0,0,0);
  mesh.addPoint(pt1);
  DPoint pt2=new DPoint(6,0,0);
  mesh.addPoint(pt2);
  DPoint pt3=new DPoint(3,5,0);
  mesh.addPoint(pt3);
  mesh.processDelaunay();
  DTriangle tri=mesh.getTriangleList().get(0);
  DEdge e1=mesh.getEdges().get(0);
  DEdge e2=mesh.getEdges().get(1);
  DEdge e3=mesh.getEdges().get(2);
  mesh.initPointInTriangle(new DPoint(3,2,0),tri,new LinkedList<DEdge>());
  DPoint pt;
  if (!tri.belongsTo(pt1)) {
    pt=pt1;
  }
 else   if (!tri.belongsTo(pt2)) {
    pt=pt2;
  }
 else {
    pt=pt3;
  }
  mesh.revertPointInTriangleInsertion(tri,new DPoint(3,2,0),pt,e1,e3);
  List<DTriangle> tris=mesh.getTriangleList();
  assertTrue(tris.size() == 1);
  assertEquals(new DTriangle(new DEdge(0,0,0,6,0,0),new DEdge(6,0,0,3,5,0),new DEdge(3,5,0,0,0,0)),tris.get(0));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(6,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,5,0)));
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,6,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(3,5,0,6,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,5,0)));
  assertTrue(mesh.getPoints().get(0) == pt1);
  assertTrue(mesh.getPoints().get(1) == pt3);
  assertTrue(mesh.getPoints().get(2) == pt2);
  assertCoherence(mesh);
  DTriangle dt=mesh.getTriangleList().get(0);
  DEdge ed=dt.getEdge(0);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
  assertTrue(ed == e1 || ed == e2 || ed == e3);
  ed=dt.getEdge(2);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
  assertTrue(ed == e1 || ed == e2 || ed == e3);
  ed=dt.getEdge(1);
  assertTrue(ed.getLeft() == dt || ed.getRight() == dt);
  assertTrue(ed == e1 || ed == e2 || ed == e3);
}