Matrix3 { public Matrix3 set(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33) { this.m[0] = m11; this.m[1] = m12; this.m[2] = m13; this.m[3] = m21; this.m[4] = m22; this.m[5] = m23; this.m[6] = m31; this.m[7] = m32; this.m[8] = m33; return this; } Matrix3();  Matrix3(double m11, double m12, double m13,
                   double m21, double m22, double m23,
                   double m31, double m32, double m33);  Matrix3(Matrix3 matrix); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Matrix3 set(double m11, double m12, double m13,
                       double m21, double m22, double m23,
                       double m31, double m32, double m33); Matrix3 set(Matrix3 matrix); Matrix3 setTranslation(double x, double y); Matrix3 setRotation(double angleDegrees); Matrix3 setScale(double xScale, double yScale); Matrix3 setToIdentity(); Matrix3 setToTranslation(double x, double y); Matrix3 setToRotation(double angleDegrees); Matrix3 setToScale(double xScale, double yScale); Matrix3 setToVerticalFlip(); Matrix3 setToTileTransform(Sector src, Sector dst); Matrix3 setToMultiply(Matrix3 a, Matrix3 b); Matrix3 multiplyByTranslation(double x, double y); Matrix3 multiplyByRotation(double angleDegrees); Matrix3 multiplyByScale(double xScale, double yScale); Matrix3 multiplyByVerticalFlip(); Matrix3 multiplyByTileTransform(Sector src, Sector dst); Matrix3 multiplyByMatrix(Matrix3 matrix); Matrix3 multiplyByMatrix(double m11, double m12, double m13,
                                    double m21, double m22, double m23,
                                    double m31, double m32, double m33); Matrix3 transpose(); Matrix3 transposeMatrix(Matrix3 matrix); float[] transposeToArray(float[] result, int offset); Matrix3 invert(); Matrix3 invertMatrix(Matrix3 matrix); final double[] m; }
@Test public void testSet() throws Exception { Matrix3 m1 = new Matrix3(); Matrix3 m2 = new Matrix3(11d, 12d, 13d, 21d, 22d, 23d, 31d, 32d, 33d); Matrix3 m3 = m1.set(m2); assertEquals("set method argument", m2, m1); assertSame("fluent api result", m3, m1); }
@Test(expected = IllegalArgumentException.class) public void testSet_WithNull() throws Exception { Matrix3 m1 = new Matrix3(); m1.set(null); fail("Expected an IllegalArgumentException to be thrown."); }
@Test public void testSet_Doubles() throws Exception { final double m11 = 11d; final double m12 = 12d; final double m13 = 13d; final double m21 = 21d; final double m22 = 22d; final double m23 = 23d; final double m31 = 31d; final double m32 = 32d; final double m33 = 33d; Matrix3 m1 = new Matrix3(); Matrix3 m2 = m1.set(m11, m12, m13, m21, m22, m23, m31, m32, m33); assertEquals("m11", m11, m1.m[0], 0); assertEquals("m12", m12, m1.m[1], 0); assertEquals("m13", m13, m1.m[2], 0); assertEquals("m21", m21, m1.m[3], 0); assertEquals("m22", m22, m1.m[4], 0); assertEquals("m23", m23, m1.m[5], 0); assertEquals("m31", m31, m1.m[6], 0); assertEquals("m32", m32, m1.m[7], 0); assertEquals("m33", m33, m1.m[8], 0); assertSame("fluent api result", m2, m1); }