Program: 57165
Project: 57165
Buggy source:
@Test public void testIsometry() throws MathArithmeticException, MathIllegalArgumentException {
  Vector3D vertex1=new Vector3D(1.1,2.2,3.3);
  Vector3D vertex2=new Vector3D(2.0,2.4,4.2);
  Vector3D vertex3=new Vector3D(2.8,3.3,3.7);
  Vector3D vertex4=new Vector3D(1.0,3.6,4.5);
  @SuppressWarnings("String_Node_Str") PolyhedronsSet tree=(PolyhedronsSet)new RegionFactory<Euclidean3D>().buildConvex(new Plane(vertex3,vertex2,vertex1,1.0e-10),new Plane(vertex2,vertex3,vertex4,1.0e-10),new Plane(vertex4,vertex3,vertex1,1.0e-10),new Plane(vertex1,vertex2,vertex4,1.0e-10));
  Vector3D barycenter=(Vector3D)tree.getBarycenter();
  Vector3D s=new Vector3D(10.2,4.3,-6.7);
  Vector3D c=new Vector3D(-0.2,2.1,-3.2);
  Rotation r=new Rotation(new Vector3D(6.2,-4.4,2.1),0.12);
  tree=tree.rotate(c,r).translate(s);
  Vector3D newB=new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(barycenter.subtract(c)));
  Assert.assertEquals(0.0,newB.subtract((Vector<Euclidean3D>)tree.getBarycenter()).getNorm(),1.0e-10);
  final Vector3D[] expectedV=new Vector3D[]{new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex1.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex2.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex3.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex4.subtract(c)))};
  tree.getTree(true).visit(new BSPTreeVisitor<Euclidean3D>(){
    public Order visitOrder(    BSPTree<Euclidean3D> node){
      return Order.MINUS_SUB_PLUS;
    }
    public void visitInternalNode(    BSPTree<Euclidean3D> node){
      @SuppressWarnings("String_Node_Str") BoundaryAttribute<Euclidean3D> attribute=(BoundaryAttribute<Euclidean3D>)node.getAttribute();
      if (attribute.getPlusOutside() != null) {
        checkFacet((SubPlane)attribute.getPlusOutside());
      }
      if (attribute.getPlusInside() != null) {
        checkFacet((SubPlane)attribute.getPlusInside());
      }
    }
    public void visitLeafNode(    BSPTree<Euclidean3D> node){
    }
    private void checkFacet(    SubPlane facet){
      Plane plane=(Plane)facet.getHyperplane();
      Vector2D[][] vertices=((PolygonsSet)facet.getRemainingRegion()).getVertices();
      Assert.assertEquals(1,vertices.length);
      for (int i=0; i < vertices[0].length; ++i) {
        Vector3D v=plane.toSpace(vertices[0][i]);
        double d=Double.POSITIVE_INFINITY;
        for (int k=0; k < expectedV.length; ++k) {
          d=FastMath.min(d,v.subtract(expectedV[k]).getNorm());
        }
        Assert.assertEquals(0,d,1.0e-10);
      }
    }
  }
);
}

Fixed version (ground truth):
@Test public void testIsometry() throws MathArithmeticException, MathIllegalArgumentException {
  Vector3D vertex1=new Vector3D(1.1,2.2,3.3);
  Vector3D vertex2=new Vector3D(2.0,2.4,4.2);
  Vector3D vertex3=new Vector3D(2.8,3.3,3.7);
  Vector3D vertex4=new Vector3D(1.0,3.6,4.5);
  PolyhedronsSet tree=(PolyhedronsSet)new RegionFactory<Euclidean3D>().buildConvex(new Plane(vertex3,vertex2,vertex1,1.0e-10),new Plane(vertex2,vertex3,vertex4,1.0e-10),new Plane(vertex4,vertex3,vertex1,1.0e-10),new Plane(vertex1,vertex2,vertex4,1.0e-10));
  Vector3D barycenter=(Vector3D)tree.getBarycenter();
  Vector3D s=new Vector3D(10.2,4.3,-6.7);
  Vector3D c=new Vector3D(-0.2,2.1,-3.2);
  Rotation r=new Rotation(new Vector3D(6.2,-4.4,2.1),0.12);
  tree=tree.rotate(c,r).translate(s);
  Vector3D newB=new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(barycenter.subtract(c)));
  Assert.assertEquals(0.0,newB.subtract((Vector<Euclidean3D>)tree.getBarycenter()).getNorm(),1.0e-10);
  final Vector3D[] expectedV=new Vector3D[]{new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex1.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex2.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex3.subtract(c))),new Vector3D(1.0,s,1.0,c,1.0,r.applyTo(vertex4.subtract(c)))};
  tree.getTree(true).visit(new BSPTreeVisitor<Euclidean3D>(){
    public Order visitOrder(    BSPTree<Euclidean3D> node){
      return Order.MINUS_SUB_PLUS;
    }
    public void visitInternalNode(    BSPTree<Euclidean3D> node){
      @SuppressWarnings("String_Node_Str") BoundaryAttribute<Euclidean3D> attribute=(BoundaryAttribute<Euclidean3D>)node.getAttribute();
      if (attribute.getPlusOutside() != null) {
        checkFacet((SubPlane)attribute.getPlusOutside());
      }
      if (attribute.getPlusInside() != null) {
        checkFacet((SubPlane)attribute.getPlusInside());
      }
    }
    public void visitLeafNode(    BSPTree<Euclidean3D> node){
    }
    private void checkFacet(    SubPlane facet){
      Plane plane=(Plane)facet.getHyperplane();
      Vector2D[][] vertices=((PolygonsSet)facet.getRemainingRegion()).getVertices();
      Assert.assertEquals(1,vertices.length);
      for (int i=0; i < vertices[0].length; ++i) {
        Vector3D v=plane.toSpace(vertices[0][i]);
        double d=Double.POSITIVE_INFINITY;
        for (int k=0; k < expectedV.length; ++k) {
          d=FastMath.min(d,v.subtract(expectedV[k]).getNorm());
        }
        Assert.assertEquals(0,d,1.0e-10);
      }
    }
  }
);
}