TransformGroup transformGroup = (TransformGroup) leafBranchGroup.getChild(0);
// test translation and rotation
Transform3D transform3D = new Transform3D();
transformGroup.getTransform(transform3D);
Matrix3d rotationMatrix = new Matrix3d();
Vector3d translationVector = new Vector3d();
transform3D.get(rotationMatrix, translationVector);
Matrix3d expectedRotationMatrix = new Matrix3d();
TreeLeaf treeLeaf = mockBranchPart.getLeaves().get(nbLeavesFound);
double rotation = treeLeaf.getTreeLeaf3D().getState().getRotation();
expectedRotationMatrix.rotY(rotation);
MatrixTestHelper.assertMatrixEquals(expectedRotationMatrix, rotationMatrix);
Point3d leafAttachPoint = treeLeaf.getTreeLeaf3D().getState().getLeafAttachPoint().toPointValue();
Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);