@Test
    public void testIssue1388() {
        Vector3f in = new Vector3f(4f, 6f, 9f); // test vector, never modified
        Vector3f saveIn = in.clone();
        /*
         * Three arbitrary rotation angles between -PI/2 and +PI/2
         */
        final float xAngle = 1.23f;
        final float yAngle = 0.765f;
        final float zAngle = -0.456f;
        float[] angles = new float[]{xAngle, yAngle, zAngle};
        float[] saveAngles = new float[]{xAngle, yAngle, zAngle};
        /*
         * Part 1: verify that the extrinsic rotation order is x-z-y
         *
         * Apply extrinsic rotations to the "in" vector in x-z-y order.
         */
        Quaternion qx = new Quaternion().fromAngleAxis(xAngle, Vector3f.UNIT_X);
        Quaternion qy = new Quaternion().fromAngleAxis(yAngle, Vector3f.UNIT_Y);
        Quaternion qz = new Quaternion().fromAngleAxis(zAngle, Vector3f.UNIT_Z);
        Vector3f outXZY = qx.mult(in);
        qz.mult(outXZY, outXZY);
        qy.mult(outXZY, outXZY);
        /*
         * Construct a Quaternion using fromAngles(float, float, float),
         * use it to rotate the "in" vector, and compare.
         */
        Quaternion q1 = new Quaternion().fromAngles(xAngle, yAngle, zAngle);
        Vector3f out1 = q1.mult(in);
        assertEquals(outXZY, out1, 1e-5f);
        /*
         * Construct a Quaternion using fromAngles(float[]),
         * use it to rotate the "in" vector, and compare.
         */
        Quaternion q2 = new Quaternion().fromAngles(angles);
        Vector3f out2 = q2.mult(in);
        assertEquals(outXZY, out2, 1e-5f);
        /*
         * Construct a Quaternion using only the constructor,
         * use it to rotate the "in" vector, and compare.
         */
        Quaternion q3 = new Quaternion(angles);
        Vector3f out3 = q3.mult(in);
        assertEquals(outXZY, out3, 1e-5f);
        /*
         * Verify that fromAngles() reverses toAngles() for the chosen angles.
         */
        float[] out4 = q1.toAngles(null);
        assertEquals(angles, out4, 1e-5f);
        float[] out5 = q2.toAngles(null);
        assertEquals(angles, out5, 1e-5f);
        float[] out6 = q3.toAngles(null);
        assertEquals(angles, out6, 1e-5f);
        /*
         * Part 2: verify intrinsic rotation order
         *
         * Apply intrinsic rotations to the "in" vector in y-z'-x" order.
         */
        Quaternion q4 = qy.mult(qz).mult(qx);
        Vector3f out7 = q4.mult(in);
        assertEquals(outXZY, out7, 1e-5f);
        /*
         * Verify that the values of "saveAngles" and "in" haven't changed.
         */
        assertEquals(saveAngles, angles, 0f);
        assertEquals(saveIn, in, 0f);
    }
Verify the order in which Tait-Bryan angles are applied by the Quaternion
class. This was issue #1388 at GitHub.

@author Stephen Gold
jme3-core/src/test/java/com/jme3/math/TestIssue1388.java