Program: 86551
Project: 86551
Buggy source:
public void testRevertPointOnEdgebranches() throws DelaunayError {
  ConstrainedMesh mesh=new ConstrainedMesh();
  DPoint p1=new DPoint(0,0,0);
  mesh.addPoint(p1);
  DPoint p2=new DPoint(3,0,0);
  mesh.addPoint(p2);
  DPoint p3=new DPoint(2,3,0);
  mesh.addPoint(p3);
  mesh.processDelaunay();
  List<DEdge> edges=mesh.getEdges();
  int index=edges.indexOf(new DEdge(0,0,0,2,3,0));
  DEdge e=edges.get(index);
  if (e.getRight() == null) {
    e.swap();
  }
  index=edges.indexOf(new DEdge(3,0,0,2,3,0));
  DEdge last=edges.get(index);
  mesh.initPointOnEdge(new DPoint(1,1.5,0),e,new LinkedList<DEdge>());
  mesh.revertPointOnEdgeInsertion(e,new DPoint(1,1.5,0),p3,null,last);
  assertTrue(mesh.getTriangleList().size() == 1);
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(2,3,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,2,3,0)));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(2,3,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,0,0)));
  assertCoherence(mesh);
  mesh=new ConstrainedMesh();
  p1=new DPoint(0,0,0);
  mesh.addPoint(p1);
  p2=new DPoint(3,0,0);
  mesh.addPoint(p2);
  p3=new DPoint(2,3,0);
  mesh.addPoint(p3);
  mesh.processDelaunay();
  edges=mesh.getEdges();
  index=edges.indexOf(new DEdge(0,0,0,2,3,0));
  e=edges.get(index);
  if (e.getLeft() == null) {
    e.swap();
  }
  index=edges.indexOf(new DEdge(3,0,0,0,0,0));
  last=edges.get(index);
  mesh.initPointOnEdge(new DPoint(1,1.5,0),e,new LinkedList<DEdge>());
  mesh.revertPointOnEdgeInsertion(e,new DPoint(1,1.5,0),p1,last,null);
  assertTrue(mesh.getTriangleList().size() == 1);
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(2,3,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,2,3,0)));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(2,3,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,0,0)));
  assertCoherence(mesh);
}

Fixed version (ground truth):
public void testRevertPointOnEdgebranches() throws DelaunayError {
  ConstrainedMesh mesh=new ConstrainedMesh();
  DPoint p1=new DPoint(0,0,0);
  mesh.addPoint(p1);
  DPoint p2=new DPoint(3,0,0);
  mesh.addPoint(p2);
  DPoint p3=new DPoint(2,3,0);
  mesh.addPoint(p3);
  mesh.processDelaunay();
  List<DEdge> edges=mesh.getEdges();
  int index=edges.indexOf(new DEdge(0,0,0,2,3,0));
  DEdge e=edges.get(index);
  if (e.getRight() == null) {
    e.swap();
  }
  index=edges.indexOf(new DEdge(3,0,0,2,3,0));
  DEdge last=edges.get(index);
  mesh.initPointOnEdge(new DPoint(1,1.5,0),e,new LinkedList<DEdge>());
  mesh.revertPointOnEdgeInsertion(e,new DPoint(1,1.5,0),p3,null,last);
  assertTrue(mesh.getTriangleList().size() == 1);
  assertTrue(mesh.getTriangleList().contains(new DTriangle(new DEdge(0,0,0,3,0,0),new DEdge(3,0,0,2,3,0),new DEdge(2,3,0,0,0,0))));
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(2,3,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,2,3,0)));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(2,3,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,0,0)));
  assertCoherence(mesh);
  mesh=new ConstrainedMesh();
  p1=new DPoint(0,0,0);
  mesh.addPoint(p1);
  p2=new DPoint(3,0,0);
  mesh.addPoint(p2);
  p3=new DPoint(2,3,0);
  mesh.addPoint(p3);
  mesh.processDelaunay();
  edges=mesh.getEdges();
  index=edges.indexOf(new DEdge(0,0,0,2,3,0));
  e=edges.get(index);
  if (e.getLeft() == null) {
    e.swap();
  }
  index=edges.indexOf(new DEdge(3,0,0,0,0,0));
  last=edges.get(index);
  mesh.initPointOnEdge(new DPoint(1,1.5,0),e,new LinkedList<DEdge>());
  mesh.revertPointOnEdgeInsertion(e,new DPoint(1,1.5,0),p1,last,null);
  assertTrue(mesh.getTriangleList().size() == 1);
  assertTrue(mesh.getTriangleList().contains(new DTriangle(new DEdge(0,0,0,3,0,0),new DEdge(3,0,0,2,3,0),new DEdge(2,3,0,0,0,0))));
  assertTrue(mesh.getEdges().size() == 3);
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(2,3,0,3,0,0)));
  assertTrue(mesh.getEdges().contains(new DEdge(0,0,0,2,3,0)));
  assertTrue(mesh.getPoints().size() == 3);
  assertTrue(mesh.getPoints().contains(new DPoint(0,0,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(2,3,0)));
  assertTrue(mesh.getPoints().contains(new DPoint(3,0,0)));
  assertCoherence(mesh);
}