diff --git a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/MathArraysTest.java b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/MathArraysTest.java index aa71a74a0..0a95cb09c 100644 --- a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/MathArraysTest.java +++ b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/MathArraysTest.java @@ -246,57 +246,57 @@ public class MathArraysTest { @Test public void testIsMonotonicComparable() { - Assert.assertFalse(MathArrays.isMonotonic(new Double[] {new Double(-15), - new Double(-5.5), - new Double(-1), - new Double(-1), - new Double(2), - new Double(15) }, + Assert.assertFalse(MathArrays.isMonotonic(new Double[] {Double.valueOf(-15), + Double.valueOf(-5.5), + Double.valueOf(-1), + Double.valueOf(-1), + Double.valueOf(2), + Double.valueOf(15) }, MathArrays.OrderDirection.INCREASING, true)); - Assert.assertTrue(MathArrays.isMonotonic(new Double[] {new Double(-15), - new Double(-5.5), - new Double(-1), - new Double(0), - new Double(2), - new Double(15) }, + Assert.assertTrue(MathArrays.isMonotonic(new Double[] {Double.valueOf(-15), + Double.valueOf(-5.5), + Double.valueOf(-1), + Double.valueOf(0), + Double.valueOf(2), + Double.valueOf(15) }, MathArrays.OrderDirection.INCREASING, true)); - Assert.assertFalse(MathArrays.isMonotonic(new Double[] {new Double(-15), - new Double(-5.5), - new Double(-1), - new Double(-2), - new Double(2) }, + Assert.assertFalse(MathArrays.isMonotonic(new Double[] {Double.valueOf(-15), + Double.valueOf(-5.5), + Double.valueOf(-1), + Double.valueOf(-2), + Double.valueOf(2) }, MathArrays.OrderDirection.INCREASING, false)); - Assert.assertTrue(MathArrays.isMonotonic(new Double[] {new Double(-15), - new Double(-5.5), - new Double(-1), - new Double(-1), - new Double(2) }, + Assert.assertTrue(MathArrays.isMonotonic(new Double[] {Double.valueOf(-15), + Double.valueOf(-5.5), + Double.valueOf(-1), + Double.valueOf(-1), + Double.valueOf(2) }, MathArrays.OrderDirection.INCREASING, false)); - Assert.assertFalse(MathArrays.isMonotonic(new Double[] {new Double(3), - new Double(3), - new Double(-5.5), - new Double(-11), - new Double(-27.5) }, + Assert.assertFalse(MathArrays.isMonotonic(new Double[] {Double.valueOf(3), + Double.valueOf(3), + Double.valueOf(-5.5), + Double.valueOf(-11), + Double.valueOf(-27.5) }, MathArrays.OrderDirection.DECREASING, true)); - Assert.assertTrue(MathArrays.isMonotonic(new Double[] {new Double(3), - new Double(2), - new Double(-5.5), - new Double(-11), - new Double(-27.5) }, + Assert.assertTrue(MathArrays.isMonotonic(new Double[] {Double.valueOf(3), + Double.valueOf(2), + Double.valueOf(-5.5), + Double.valueOf(-11), + Double.valueOf(-27.5) }, MathArrays.OrderDirection.DECREASING, true)); - Assert.assertFalse(MathArrays.isMonotonic(new Double[] {new Double(3), - new Double(-1), - new Double(0), - new Double(-5.5), - new Double(-11), - new Double(-27.5) }, + Assert.assertFalse(MathArrays.isMonotonic(new Double[] {Double.valueOf(3), + Double.valueOf(-1), + Double.valueOf(0), + Double.valueOf(-5.5), + Double.valueOf(-11), + Double.valueOf(-27.5) }, MathArrays.OrderDirection.DECREASING, false)); - Assert.assertTrue(MathArrays.isMonotonic(new Double[] {new Double(3), - new Double(0), - new Double(0), - new Double(-5.5), - new Double(-11), - new Double(-27.5) }, + Assert.assertTrue(MathArrays.isMonotonic(new Double[] {Double.valueOf(3), + Double.valueOf(0), + Double.valueOf(0), + Double.valueOf(-5.5), + Double.valueOf(-11), + Double.valueOf(-27.5) }, MathArrays.OrderDirection.DECREASING, false)); } diff --git a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/PairTest.java b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/PairTest.java index b1327a357..8d21f3f8d 100644 --- a/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/PairTest.java +++ b/commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/PairTest.java @@ -27,15 +27,15 @@ public class PairTest { @Test public void testAccessor() { final Pair p - = new Pair<>(new Integer(1), new Double(2)); - Assert.assertEquals(new Integer(1), p.getKey()); + = new Pair<>(Integer.valueOf(1), Double.valueOf(2)); + Assert.assertEquals(Integer.valueOf(1), p.getKey()); Assert.assertEquals(2, p.getValue().doubleValue(), Math.ulp(1d)); } @Test public void testAccessor2() { final Pair p - = new Pair<>(new Integer(1), new Double(2)); + = new Pair<>(Integer.valueOf(1), Double.valueOf(2)); // Check that both APIs refer to the same data. @@ -51,13 +51,13 @@ public class PairTest { Pair p2 = new Pair<>(null, null); Assert.assertEquals(p1, p2); - p1 = new Pair<>(new Integer(1), new Double(2)); + p1 = new Pair<>(Integer.valueOf(1), Double.valueOf(2)); Assert.assertNotEquals(p1, p2); - p2 = new Pair<>(new Integer(1), new Double(2)); + p2 = new Pair<>(Integer.valueOf(1), Double.valueOf(2)); Assert.assertEquals(p1, p2); - Pair p3 = new Pair<>(new Integer(1), new Float(2)); + Pair p3 = new Pair<>(Integer.valueOf(1), Float.valueOf(2)); Assert.assertNotEquals(p1, p3); }