commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [46/57] [abbrv] [math] Remove redundant type arguments.
Date Tue, 20 Sep 2016 18:20:31 GMT
http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
index 29564e6..fc2bc68 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
@@ -42,8 +42,8 @@ public class FieldVector3DTest {
         double sinAlpha = FastMath.sqrt(3) / 2.0;
         double cosDelta = FastMath.sqrt(2) / 2.0;
         double sinDelta = -FastMath.sqrt(2) / 2.0;
-        FieldVector3D<DerivativeStructure> u = new FieldVector3D<DerivativeStructure>(2,
-                new FieldVector3D<DerivativeStructure>(new DerivativeStructure(2, 1, 0,  FastMath.PI / 3),
+        FieldVector3D<DerivativeStructure> u = new FieldVector3D<>(2,
+                new FieldVector3D<>(new DerivativeStructure(2, 1, 0,  FastMath.PI / 3),
                         new DerivativeStructure(2, 1, 1, -FastMath.PI / 4)));
         checkVector(u, 2 * cosAlpha * cosDelta, 2 * sinAlpha * cosDelta, 2 * sinDelta);
         Assert.assertEquals(-2 * sinAlpha * cosDelta, u.getX().getPartialDerivative(1, 0), 1.0e-12);
@@ -53,41 +53,41 @@ public class FieldVector3DTest {
         Assert.assertEquals(-2 * sinAlpha * sinDelta, u.getY().getPartialDerivative(0, 1), 1.0e-12);
         Assert.assertEquals(2 * cosDelta,             u.getZ().getPartialDerivative(0, 1), 1.0e-12);
 
-        checkVector(new FieldVector3D<DerivativeStructure>(2, createVector(1, 0,  0, 3)),
+        checkVector(new FieldVector3D<>(2, createVector(1, 0,  0, 3)),
                                    2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    createVector(1, 0,  0, 4)),
                                    2, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 0, 0, 2, 0);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    new Vector3D(1, 0,  0)),
                                    2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
 
-        checkVector(new FieldVector3D<DerivativeStructure>(2, createVector(1, 0,  0, 3),
+        checkVector(new FieldVector3D<>(2, createVector(1, 0,  0, 3),
                                    -3, createVector(0, 0, -1, 3)),
                                    2, 0, 3, -1, 0, 0, 0, -1, 0, 0, 0, -1);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    createVector(1, 0,  0, 4),
                                    new DerivativeStructure(4, 1, 3, -3.0),
                                    createVector(0, 0, -1, 4)),
                                    2, 0, 3, -1, 0, 0, 1, 0, -1, 0, 0, 0, 0, -1, -1);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    new Vector3D(1, 0,  0),
                                    new DerivativeStructure(4, 1, 3, -3.0),
                                    new Vector3D(0, 0, -1)),
                                    2, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1);
 
-        checkVector(new FieldVector3D<DerivativeStructure>(2, createVector(1, 0, 0, 3),
+        checkVector(new FieldVector3D<>(2, createVector(1, 0, 0, 3),
                                    5, createVector(0, 1, 0, 3),
                                    -3, createVector(0, 0, -1, 3)),
                                    2, 5, 3, 4, 0, 0, 0, 4, 0, 0, 0, 4);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    createVector(1, 0,  0, 4),
                                    new DerivativeStructure(4, 1, 3,  5.0),
                                    createVector(0, 1,  0, 4),
                                    new DerivativeStructure(4, 1, 3, -3.0),
                                    createVector(0, 0, -1, 4)),
                                    2, 5, 3, 4, 0, 0, 1, 0, 4, 0, 1, 0, 0, 4, -1);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    new Vector3D(1, 0,  0),
                                    new DerivativeStructure(4, 1, 3,  5.0),
                                    new Vector3D(0, 1,  0),
@@ -95,12 +95,12 @@ public class FieldVector3DTest {
                                    new Vector3D(0, 0, -1)),
                                    2, 5, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -1);
 
-        checkVector(new FieldVector3D<DerivativeStructure>(2, createVector(1, 0, 0, 3),
+        checkVector(new FieldVector3D<>(2, createVector(1, 0, 0, 3),
                                    5, createVector(0, 1, 0, 3),
                                    5, createVector(0, -1, 0, 3),
                                    -3, createVector(0, 0, -1, 3)),
                                    2, 0, 3, 9, 0, 0, 0, 9, 0, 0, 0, 9);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    createVector(1, 0,  0, 4),
                                    new DerivativeStructure(4, 1, 3,  5.0),
                                    createVector(0, 1,  0, 4),
@@ -109,7 +109,7 @@ public class FieldVector3DTest {
                                    new DerivativeStructure(4, 1, 3, -3.0),
                                    createVector(0, 0, -1, 4)),
                                    2, 0, 3, 9, 0, 0, 1, 0, 9, 0, 0, 0, 0, 9, -1);
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(4, 1, 3,  2.0),
+        checkVector(new FieldVector3D<>(new DerivativeStructure(4, 1, 3,  2.0),
                                    new Vector3D(1, 0,  0),
                                    new DerivativeStructure(4, 1, 3,  5.0),
                                    new Vector3D(0, 1,  0),
@@ -119,7 +119,7 @@ public class FieldVector3DTest {
                                    new Vector3D(0, 0, -1)),
                                    2, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1);
 
-        checkVector(new FieldVector3D<DerivativeStructure>(new DerivativeStructure[] {
+        checkVector(new FieldVector3D<>(new DerivativeStructure[] {
             new DerivativeStructure(3, 1, 2,  2),
             new DerivativeStructure(3, 1, 1,  5),
             new DerivativeStructure(3, 1, 0, -3)
@@ -133,16 +133,16 @@ public class FieldVector3DTest {
         FieldVector3D<DerivativeStructure> u1 = createVector(1, 2, 3, 3);
         FieldVector3D<DerivativeStructure> v  = createVector(1, 2, 3 + 10 * Precision.EPSILON, 3);
         Assert.assertTrue(u1.equals(u1));
-        Assert.assertTrue(u1.equals(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(3, 1, 0, 1.0),
+        Assert.assertTrue(u1.equals(new FieldVector3D<>(new DerivativeStructure(3, 1, 0, 1.0),
                                                    new DerivativeStructure(3, 1, 1, 2.0),
                                                    new DerivativeStructure(3, 1, 2, 3.0))));
-        Assert.assertFalse(u1.equals(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(3, 1, 1.0),
+        Assert.assertFalse(u1.equals(new FieldVector3D<>(new DerivativeStructure(3, 1, 1.0),
                                                     new DerivativeStructure(3, 1, 1, 2.0),
                                                     new DerivativeStructure(3, 1, 2, 3.0))));
-        Assert.assertFalse(u1.equals(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(3, 1, 0, 1.0),
+        Assert.assertFalse(u1.equals(new FieldVector3D<>(new DerivativeStructure(3, 1, 0, 1.0),
                                                     new DerivativeStructure(3, 1, 2.0),
                                                     new DerivativeStructure(3, 1, 2, 3.0))));
-        Assert.assertFalse(u1.equals(new FieldVector3D<DerivativeStructure>(new DerivativeStructure(3, 1, 0, 1.0),
+        Assert.assertFalse(u1.equals(new FieldVector3D<>(new DerivativeStructure(3, 1, 0, 1.0),
                                                     new DerivativeStructure(3, 1, 1, 2.0),
                                                     new DerivativeStructure(3, 1, 3.0))));
         Assert.assertFalse(u1.equals(v));
@@ -185,7 +185,7 @@ public class FieldVector3DTest {
 
     @Test(expected=DimensionMismatchException.class)
     public void testWrongDimension() throws DimensionMismatchException {
-        new FieldVector3D<DerivativeStructure>(new DerivativeStructure[] {
+        new FieldVector3D<>(new DerivativeStructure[] {
             new DerivativeStructure(3, 1, 0, 2),
             new DerivativeStructure(3, 1, 0, 5)
         });
@@ -476,8 +476,8 @@ public class FieldVector3DTest {
         checkVector(FieldVector3D.crossProduct(v1, v2), -1, 2, 1);
 
         double scale    = FastMath.scalb(1.0, 100);
-        FieldVector3D<DerivativeStructure> big1   = new FieldVector3D<DerivativeStructure>(scale, v1);
-        FieldVector3D<DerivativeStructure> small2 = new FieldVector3D<DerivativeStructure>(1 / scale, v2);
+        FieldVector3D<DerivativeStructure> big1   = new FieldVector3D<>(scale, v1);
+        FieldVector3D<DerivativeStructure> small2 = new FieldVector3D<>(1 / scale, v2);
         checkVector(FieldVector3D.crossProduct(big1, small2), -1, 2, 1);
 
     }
@@ -638,7 +638,7 @@ public class FieldVector3DTest {
         final FieldVector3D<DerivativeStructure> u3 = createVector(12753243807587107.0 / 18446744073709551616.0,
                                          -2313766922703915.0 / 18446744073709551616.0,
                                           -227970081415313.0 /   288230376151711744.0, 3);
-        FieldVector3D<DerivativeStructure> cNaive = new FieldVector3D<DerivativeStructure>(u1.getY().multiply(u2.getZ()).subtract(u1.getZ().multiply(u2.getY())),
+        FieldVector3D<DerivativeStructure> cNaive = new FieldVector3D<>(u1.getY().multiply(u2.getZ()).subtract(u1.getZ().multiply(u2.getY())),
                                        u1.getZ().multiply(u2.getX()).subtract(u1.getX().multiply(u2.getZ())),
                                        u1.getX().multiply(u2.getY()).subtract(u1.getY().multiply(u2.getX())));
         FieldVector3D<DerivativeStructure> cAccurate = FieldVector3D.crossProduct(u1, u2);
@@ -680,7 +680,7 @@ public class FieldVector3DTest {
     }
 
     private FieldVector3D<DerivativeStructure> createVector(double x, double y, double z, int params) {
-        return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(params, 1, 0, x),
+        return new FieldVector3D<>(new DerivativeStructure(params, 1, 0, x),
                               new DerivativeStructure(params, 1, 1, y),
                               new DerivativeStructure(params, 1, 2, z));
     }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PLYParser.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PLYParser.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PLYParser.java
index f65663c..7670e69 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PLYParser.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PLYParser.java
@@ -214,7 +214,7 @@ public class PLYParser {
      */
     private List<Field> parseNextLine()
         throws IOException, ParseException {
-        final List<Field> fields = new ArrayList<Field>();
+        final List<Field> fields = new ArrayList<>();
         line = br.readLine();
         if (line == null) {
             throw new EOFException();

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
index e8498d8..c3d032d 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
@@ -243,7 +243,7 @@ public class PolyhedronsSetTest {
             new PolyhedronsSet(x - w, x + w, y - l, y + l, z - w, z + w, 1.0e-10);
         PolyhedronsSet zBeam =
             new PolyhedronsSet(x - w, x + w, y - w, y + w, z - l, z + l, 1.0e-10);
-        RegionFactory<Euclidean3D> factory = new RegionFactory<Euclidean3D>();
+        RegionFactory<Euclidean3D> factory = new RegionFactory<>();
         PolyhedronsSet tree = (PolyhedronsSet) factory.union(xBeam, factory.union(yBeam, zBeam));
         Vector3D barycenter = (Vector3D) tree.getBarycenter();
 
@@ -273,7 +273,7 @@ public class PolyhedronsSetTest {
             1, 5, 6, 1, 6, 2,
             2, 6, 7, 2, 7, 3,
             4, 0, 3, 4, 3, 7};
-        ArrayList<SubHyperplane<Euclidean3D>> subHyperplaneList = new ArrayList<SubHyperplane<Euclidean3D>>();
+        ArrayList<SubHyperplane<Euclidean3D>> subHyperplaneList = new ArrayList<>();
         for (int idx = 0; idx < indices.length; idx += 3) {
             int idxA = indices[idx] * 3;
             int idxB = indices[idx + 1] * 3;
@@ -283,7 +283,7 @@ public class PolyhedronsSetTest {
             Vector3D v_3 = new Vector3D(coords[idxC], coords[idxC + 1], coords[idxC + 2]);
             Vector3D[] vertices = {v_1, v_2, v_3};
             Plane polyPlane = new Plane(v_1, v_2, v_3, 1.0e-10);
-            ArrayList<SubHyperplane<Euclidean2D>> lines = new ArrayList<SubHyperplane<Euclidean2D>>();
+            ArrayList<SubHyperplane<Euclidean2D>> lines = new ArrayList<>();
 
             Vector2D[] projPts = new Vector2D[vertices.length];
             for (int ptIdx = 0; ptIdx < projPts.length; ptIdx++) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
index 3d81758..2be4e96 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
@@ -144,7 +144,7 @@ public class SphereGeneratorTest {
             double d = 25 * random.nextDouble();
             double refRadius = 10 * random.nextDouble();
             Vector3D refCenter = new Vector3D(d, new Vector3D(sr.nextVector()));
-            List<Vector3D> support = new ArrayList<Vector3D>();
+            List<Vector3D> support = new ArrayList<>();
             for (int j = 0; j < 5; ++j) {
                 support.add(new Vector3D(1.0, refCenter, refRadius, new Vector3D(sr.nextVector())));
             }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
index 18c40eb..350d333 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
@@ -109,7 +109,7 @@ public class DiskGeneratorTest {
             double d = 25 * random.nextDouble();
             double refRadius = 10 * random.nextDouble();
             Vector2D refCenter = new Vector2D(d, new Vector2D(sr.nextVector()));
-            List<Vector2D> support = new ArrayList<Vector2D>();
+            List<Vector2D> support = new ArrayList<>();
             for (int j = 0; j < 3; ++j) {
                 support.add(new Vector2D(1.0, refCenter, refRadius, new Vector2D(sr.nextVector())));
             }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
index 28b5eda..bb4e51b 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
@@ -675,15 +675,15 @@ public class PolygonsSetTest {
         hyp[4] = (SubLine) hyp[4].split(hyp[3].getHyperplane()).getMinus().split(hyp[0].getHyperplane()).getMinus();
         hyp[5] = (SubLine) hyp[5].split(hyp[4].getHyperplane()).getMinus().split(hyp[0].getHyperplane()).getMinus();
         hyp[6] = (SubLine) hyp[6].split(hyp[3].getHyperplane()).getMinus().split(hyp[1].getHyperplane()).getMinus();
-        BSPTree<Euclidean2D> tree = new BSPTree<Euclidean2D>(Boolean.TRUE);
+        BSPTree<Euclidean2D> tree = new BSPTree<>(Boolean.TRUE);
         for (int i = hyp.length - 1; i >= 0; --i) {
-            tree = new BSPTree<Euclidean2D>(hyp[i], new BSPTree<Euclidean2D>(Boolean.FALSE), tree, null);
+            tree = new BSPTree<>(hyp[i], new BSPTree<Euclidean2D>(Boolean.FALSE), tree, null);
         }
         PolygonsSet set = new PolygonsSet(tree, 1.0e-10);
         SubLine splitter =
             new Line(new Vector2D(-2.0 * sqrt3 / 3.0, 0.0), 9 * pi6, 1.0e-10).wholeHyperplane();
         PolygonsSet slice =
-            new PolygonsSet(new BSPTree<Euclidean2D>(splitter,
+            new PolygonsSet(new BSPTree<>(splitter,
                                                      set.getTree(false).split(splitter).getPlus(),
                                                      new BSPTree<Euclidean2D>(Boolean.FALSE), null),
                             1.0e-10);
@@ -726,85 +726,85 @@ public class PolygonsSetTest {
     @Test
     public void testBug20040520() {
         BSPTree<Euclidean2D> a0 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.85, -0.05),
+            new BSPTree<>(buildSegment(new Vector2D(0.85, -0.05),
                                                   new Vector2D(0.90, -0.10)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE),
                                                   new BSPTree<Euclidean2D>(Boolean.TRUE),
                                                   null);
         BSPTree<Euclidean2D> a1 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.85, -0.10),
+            new BSPTree<>(buildSegment(new Vector2D(0.85, -0.10),
                                                   new Vector2D(0.90, -0.10)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE), a0, null);
         BSPTree<Euclidean2D> a2 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.90, -0.05),
+            new BSPTree<>(buildSegment(new Vector2D(0.90, -0.05),
                                                   new Vector2D(0.85, -0.05)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE), a1, null);
         BSPTree<Euclidean2D> a3 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.82, -0.05),
+            new BSPTree<>(buildSegment(new Vector2D(0.82, -0.05),
                                                   new Vector2D(0.82, -0.08)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE),
                                                   new BSPTree<Euclidean2D>(Boolean.TRUE),
                                                   null);
         BSPTree<Euclidean2D> a4 =
-            new BSPTree<Euclidean2D>(buildHalfLine(new Vector2D(0.85, -0.05),
+            new BSPTree<>(buildHalfLine(new Vector2D(0.85, -0.05),
                                                    new Vector2D(0.80, -0.05),
                                                    false),
                                                    new BSPTree<Euclidean2D>(Boolean.FALSE), a3, null);
         BSPTree<Euclidean2D> a5 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.82, -0.08),
+            new BSPTree<>(buildSegment(new Vector2D(0.82, -0.08),
                                                   new Vector2D(0.82, -0.18)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE),
                                                   new BSPTree<Euclidean2D>(Boolean.TRUE),
                                                   null);
         BSPTree<Euclidean2D> a6 =
-            new BSPTree<Euclidean2D>(buildHalfLine(new Vector2D(0.82, -0.18),
+            new BSPTree<>(buildHalfLine(new Vector2D(0.82, -0.18),
                                                    new Vector2D(0.85, -0.15),
                                                    true),
                                                    new BSPTree<Euclidean2D>(Boolean.FALSE), a5, null);
         BSPTree<Euclidean2D> a7 =
-            new BSPTree<Euclidean2D>(buildHalfLine(new Vector2D(0.85, -0.05),
+            new BSPTree<>(buildHalfLine(new Vector2D(0.85, -0.05),
                                                    new Vector2D(0.82, -0.08),
                                                    false),
                                                    a4, a6, null);
         BSPTree<Euclidean2D> a8 =
-            new BSPTree<Euclidean2D>(buildLine(new Vector2D(0.85, -0.25),
+            new BSPTree<>(buildLine(new Vector2D(0.85, -0.25),
                                                new Vector2D(0.85,  0.05)),
                                                a2, a7, null);
         BSPTree<Euclidean2D> a9 =
-            new BSPTree<Euclidean2D>(buildLine(new Vector2D(0.90,  0.05),
+            new BSPTree<>(buildLine(new Vector2D(0.90,  0.05),
                                                new Vector2D(0.90, -0.50)),
                                                a8, new BSPTree<Euclidean2D>(Boolean.FALSE), null);
 
         BSPTree<Euclidean2D> b0 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.92, -0.12),
+            new BSPTree<>(buildSegment(new Vector2D(0.92, -0.12),
                                                   new Vector2D(0.92, -0.08)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE), new BSPTree<Euclidean2D>(Boolean.TRUE),
                                                   null);
         BSPTree<Euclidean2D> b1 =
-            new BSPTree<Euclidean2D>(buildHalfLine(new Vector2D(0.92, -0.08),
+            new BSPTree<>(buildHalfLine(new Vector2D(0.92, -0.08),
                                                    new Vector2D(0.90, -0.10),
                                                    true),
                                                    new BSPTree<Euclidean2D>(Boolean.FALSE), b0, null);
         BSPTree<Euclidean2D> b2 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.92, -0.18),
+            new BSPTree<>(buildSegment(new Vector2D(0.92, -0.18),
                                                   new Vector2D(0.92, -0.12)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE), new BSPTree<Euclidean2D>(Boolean.TRUE),
                                                   null);
         BSPTree<Euclidean2D> b3 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.85, -0.15),
+            new BSPTree<>(buildSegment(new Vector2D(0.85, -0.15),
                                                   new Vector2D(0.90, -0.20)),
                                                   new BSPTree<Euclidean2D>(Boolean.FALSE), b2, null);
         BSPTree<Euclidean2D> b4 =
-            new BSPTree<Euclidean2D>(buildSegment(new Vector2D(0.95, -0.15),
+            new BSPTree<>(buildSegment(new Vector2D(0.95, -0.15),
                                                   new Vector2D(0.85, -0.05)),
                                                   b1, b3, null);
         BSPTree<Euclidean2D> b5 =
-            new BSPTree<Euclidean2D>(buildHalfLine(new Vector2D(0.85, -0.05),
+            new BSPTree<>(buildHalfLine(new Vector2D(0.85, -0.05),
                                                    new Vector2D(0.85, -0.25),
                                                    true),
                                                    new BSPTree<Euclidean2D>(Boolean.FALSE), b4, null);
         BSPTree<Euclidean2D> b6 =
-            new BSPTree<Euclidean2D>(buildLine(new Vector2D(0.0, -1.10),
+            new BSPTree<>(buildLine(new Vector2D(0.0, -1.10),
                                                new Vector2D(1.0, -0.10)),
                                                new BSPTree<Euclidean2D>(Boolean.FALSE), b5, null);
 
@@ -866,7 +866,7 @@ public class PolygonsSetTest {
         };
 
         BSPTree<Euclidean2D> node1 =
-            new BSPTree<Euclidean2D>(new SubLine(l[0],
+            new BSPTree<>(new SubLine(l[0],
                                                  new IntervalsSet(intersectionAbscissa(l[0], l[1]),
                                                                   intersectionAbscissa(l[0], l[2]),
                                                                   1.0e-10)),
@@ -874,7 +874,7 @@ public class PolygonsSetTest {
                                      new BSPTree<Euclidean2D>(Boolean.FALSE),
                                      null);
         BSPTree<Euclidean2D> node2 =
-            new BSPTree<Euclidean2D>(new SubLine(l[1],
+            new BSPTree<>(new SubLine(l[1],
                                                  new IntervalsSet(intersectionAbscissa(l[1], l[2]),
                                                                   intersectionAbscissa(l[1], l[3]),
                                                                   1.0e-10)),
@@ -882,14 +882,14 @@ public class PolygonsSetTest {
                                      new BSPTree<Euclidean2D>(Boolean.FALSE),
                                      null);
         BSPTree<Euclidean2D> node3 =
-            new BSPTree<Euclidean2D>(new SubLine(l[2],
+            new BSPTree<>(new SubLine(l[2],
                                                  new IntervalsSet(intersectionAbscissa(l[2], l[3]),
                                                  Double.POSITIVE_INFINITY, 1.0e-10)),
                                      node2,
                                      new BSPTree<Euclidean2D>(Boolean.FALSE),
                                      null);
         BSPTree<Euclidean2D> node4 =
-            new BSPTree<Euclidean2D>(l[3].wholeHyperplane(),
+            new BSPTree<>(l[3].wholeHyperplane(),
                                      node3,
                                      new BSPTree<Euclidean2D>(Boolean.FALSE),
                                      null);
@@ -1126,7 +1126,7 @@ public class PolygonsSetTest {
     @Test
     public void testThinRectangle() {
 
-        RegionFactory<Euclidean2D> factory = new RegionFactory<Euclidean2D>();
+        RegionFactory<Euclidean2D> factory = new RegionFactory<>();
         Vector2D pA = new Vector2D(0.0,        1.0);
         Vector2D pB = new Vector2D(0.0,        0.0);
         Vector2D pC = new Vector2D(1.0 / 64.0, 0.0);
@@ -1236,7 +1236,7 @@ public class PolygonsSetTest {
     }
 
     private PolygonsSet buildSet(Vector2D[][] vertices) {
-        ArrayList<SubHyperplane<Euclidean2D>> edges = new ArrayList<SubHyperplane<Euclidean2D>>();
+        ArrayList<SubHyperplane<Euclidean2D>> edges = new ArrayList<>();
         for (int i = 0; i < vertices.length; ++i) {
             int l = vertices[i].length;
             for (int j = 0; j < l; ++j) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
index 7de619a..08c0e98 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
@@ -93,7 +93,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testAllIdentical() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(1, 1));
@@ -118,7 +118,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testCollinearPoints() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -131,7 +131,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testCollinearPointsReverse() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -144,7 +144,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testCollinearPointsIncluded() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -157,7 +157,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testCollinearPointsIncludedReverse() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -170,7 +170,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testIdenticalPoints() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -183,7 +183,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testIdenticalPoints2() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -196,7 +196,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     @Test
     public void testClosePoints() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(2, 2));
         points.add(new Vector2D(2, 4));
@@ -211,7 +211,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
     public void testCollinearPointOnExistingBoundary() {
         // MATH-1135: check that collinear points on the hull are handled correctly
         //            when only a minimal hull shall be constructed
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
         points.add(new Vector2D(7.3152, 34.7472));
         points.add(new Vector2D(6.400799999999997, 34.747199999999985));
         points.add(new Vector2D(5.486399999999997, 34.7472));
@@ -233,7 +233,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
         //            make sure that they are processed in the proper order
         //            for each algorithm.
 
-        List<Vector2D> points = new ArrayList<Vector2D>();
+        List<Vector2D> points = new ArrayList<>();
 
         // first case: 3 points are collinear
         points.add(new Vector2D(16.078200000000184, -36.52519999989808));
@@ -270,7 +270,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
     @Test
     public void testIssue1123() {
 
-        List<Vector2D> points = new ArrayList<Vector2D>();
+        List<Vector2D> points = new ArrayList<>();
 
         int[][] data = new int[][] { { -11, -1 }, { -11, 0 }, { -11, 1 },
                 { -10, -3 }, { -10, -2 }, { -10, -1 }, { -10, 0 }, { -10, 1 },
@@ -367,7 +367,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
 
     protected final List<Vector2D> createRandomPoints(int size) {
         // create the cloud container
-        List<Vector2D> points = new ArrayList<Vector2D>(size);
+        List<Vector2D> points = new ArrayList<>(size);
         // fill the cloud with a random distribution of points
         for (int i = 0; i < size; i++) {
             points.add(new Vector2D(random.nextDouble() * 2.0 - 1.0, random.nextDouble() * 2.0 - 1.0));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChainTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChainTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChainTest.java
index ebc2f6c..7860b9d 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChainTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChainTest.java
@@ -40,7 +40,7 @@ public class MonotoneChainTest extends ConvexHullGenerator2DAbstractTest {
 
     @Test(expected=ConvergenceException.class)
     public void testConvergenceException() {
-        final Collection<Vector2D> points = new ArrayList<Vector2D>();
+        final Collection<Vector2D> points = new ArrayList<>();
 
         points.add(new Vector2D(1, 1));
         points.add(new Vector2D(1, 5));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/partitioning/RegionParser.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/partitioning/RegionParser.java b/src/test/java/org/apache/commons/math4/geometry/partitioning/RegionParser.java
index 29e48f3..ced1989 100644
--- a/src/test/java/org/apache/commons/math4/geometry/partitioning/RegionParser.java
+++ b/src/test/java/org/apache/commons/math4/geometry/partitioning/RegionParser.java
@@ -211,7 +211,7 @@ public class RegionParser {
             getWord(TOLERANCE);
             tolerance = getNumber();
             getWord(PLUS);
-            root = new BSPTree<S>();
+            root = new BSPTree<>();
             parseTree(root);
             if (tokenizer.hasMoreTokens()) {
                 throw new ParseException("unexpected " + tokenizer.nextToken(), 0);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSetTest.java
index e57286b..6f86857 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSetTest.java
@@ -170,7 +170,7 @@ public class ArcsSetTest {
 
     @Test
     public void testSpecialConstruction() {
-        List<SubHyperplane<Sphere1D>> boundary = new ArrayList<SubHyperplane<Sphere1D>>();
+        List<SubHyperplane<Sphere1D>> boundary = new ArrayList<>();
         boundary.add(new LimitAngle(new S1Point(0.0), false, 1.0e-10).wholeHyperplane());
         boundary.add(new LimitAngle(new S1Point(MathUtils.TWO_PI - 1.0e-11), true, 1.0e-10).wholeHyperplane());
         ArcsSet set = new ArcsSet(boundary, 1.0e-10);
@@ -271,7 +271,7 @@ public class ArcsSetTest {
 
     @Test
     public void testMultiple() {
-        RegionFactory<Sphere1D> factory = new RegionFactory<Sphere1D>();
+        RegionFactory<Sphere1D> factory = new RegionFactory<>();
         ArcsSet set = (ArcsSet)
         factory.intersection(factory.union(factory.difference(new ArcsSet(1.0, 6.0, 1.0e-10),
                                                               new ArcsSet(3.0, 5.0, 1.0e-10)),
@@ -347,9 +347,9 @@ public class ArcsSetTest {
         for (int k = -2; k < 3; ++k) {
             SubLimitAngle l1  = new LimitAngle(new S1Point(1.0 + k * MathUtils.TWO_PI), false, 1.0e-10).wholeHyperplane();
             SubLimitAngle l2  = new LimitAngle(new S1Point(1.5 + k * MathUtils.TWO_PI), true,  1.0e-10).wholeHyperplane();
-            ArcsSet set = new ArcsSet(new BSPTree<Sphere1D>(l1,
+            ArcsSet set = new ArcsSet(new BSPTree<>(l1,
                                                             new BSPTree<Sphere1D>(Boolean.FALSE),
-                                                            new BSPTree<Sphere1D>(l2,
+                                                            new BSPTree<>(l2,
                                                                                   new BSPTree<Sphere1D>(Boolean.FALSE),
                                                                                   new BSPTree<Sphere1D>(Boolean.TRUE),
                                                                                   null),
@@ -371,10 +371,10 @@ public class ArcsSetTest {
         SubLimitAngle l1 = new LimitAngle(new S1Point(1.0), false, 1.0e-10).wholeHyperplane();
         SubLimitAngle l2 = new LimitAngle(new S1Point(2.0), true,  1.0e-10).wholeHyperplane();
         SubLimitAngle l3 = new LimitAngle(new S1Point(3.0), false, 1.0e-10).wholeHyperplane();
-        new ArcsSet(new BSPTree<Sphere1D>(l1,
+        new ArcsSet(new BSPTree<>(l1,
                                           new BSPTree<Sphere1D>(Boolean.FALSE),
-                                          new BSPTree<Sphere1D>(l2,
-                                                                new BSPTree<Sphere1D>(l3,
+                                          new BSPTree<>(l2,
+                                                                new BSPTree<>(l3,
                                                                                       new BSPTree<Sphere1D>(Boolean.FALSE),
                                                                                       new BSPTree<Sphere1D>(Boolean.TRUE),
                                                                                       null),

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
index 4af52d7..d881ed8 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SphericalPolygonsSetTest.java
@@ -113,7 +113,7 @@ public class SphericalPolygonsSetTest {
     public void testPositiveOctantByIntersection() {
         double tol = 0.01;
         double sinTol = FastMath.sin(tol);
-        RegionFactory<Sphere2D> factory = new RegionFactory<Sphere2D>();
+        RegionFactory<Sphere2D> factory = new RegionFactory<>();
         SphericalPolygonsSet plusX = new SphericalPolygonsSet(Vector3D.PLUS_I, tol);
         SphericalPolygonsSet plusY = new SphericalPolygonsSet(Vector3D.PLUS_J, tol);
         SphericalPolygonsSet plusZ = new SphericalPolygonsSet(Vector3D.PLUS_K, tol);
@@ -203,7 +203,7 @@ public class SphericalPolygonsSetTest {
     public void testNonConvex() {
         double tol = 0.01;
         double sinTol = FastMath.sin(tol);
-        RegionFactory<Sphere2D> factory = new RegionFactory<Sphere2D>();
+        RegionFactory<Sphere2D> factory = new RegionFactory<>();
         SphericalPolygonsSet plusX = new SphericalPolygonsSet(Vector3D.PLUS_I, tol);
         SphericalPolygonsSet plusY = new SphericalPolygonsSet(Vector3D.PLUS_J, tol);
         SphericalPolygonsSet plusZ = new SphericalPolygonsSet(Vector3D.PLUS_K, tol);
@@ -273,7 +273,7 @@ public class SphericalPolygonsSetTest {
     @Test
     public void testModeratlyComplexShape() {
         double tol = 0.01;
-        List<SubHyperplane<Sphere2D>> boundary = new ArrayList<SubHyperplane<Sphere2D>>();
+        List<SubHyperplane<Sphere2D>> boundary = new ArrayList<>();
         boundary.add(create(Vector3D.MINUS_J, Vector3D.PLUS_I,  Vector3D.PLUS_K,  tol, 0.0, 0.5 * FastMath.PI));
         boundary.add(create(Vector3D.MINUS_I, Vector3D.PLUS_K,  Vector3D.PLUS_J,  tol, 0.0, 0.5 * FastMath.PI));
         boundary.add(create(Vector3D.PLUS_K,  Vector3D.PLUS_J,  Vector3D.MINUS_I, tol, 0.0, 0.5 * FastMath.PI));
@@ -330,7 +330,7 @@ public class SphericalPolygonsSetTest {
     public void testSeveralParts() {
         double tol = 0.01;
         double sinTol = FastMath.sin(tol);
-        List<SubHyperplane<Sphere2D>> boundary = new ArrayList<SubHyperplane<Sphere2D>>();
+        List<SubHyperplane<Sphere2D>> boundary = new ArrayList<>();
 
         // first part: +X, +Y, +Z octant
         boundary.add(create(Vector3D.PLUS_J,  Vector3D.PLUS_K,  Vector3D.PLUS_I,  tol, 0.0, 0.5 * FastMath.PI));
@@ -413,7 +413,7 @@ public class SphericalPolygonsSetTest {
         SphericalPolygonsSet triOut    = new SphericalPolygonsSet(center, Vector3D.PLUS_K, 0.25, 3, tol);
         SphericalPolygonsSet triIn     = new SphericalPolygonsSet(center, Vector3D.PLUS_K, 0.15, 3, tol);
 
-        RegionFactory<Sphere2D> factory = new RegionFactory<Sphere2D>();
+        RegionFactory<Sphere2D> factory = new RegionFactory<>();
         SphericalPolygonsSet hexa   = (SphericalPolygonsSet) factory.difference(hexaOut,   hexaIn);
         SphericalPolygonsSet penta  = (SphericalPolygonsSet) factory.difference(pentaOut,  pentaIn);
         SphericalPolygonsSet quadri = (SphericalPolygonsSet) factory.difference(quadriOut, quadriIn);
@@ -474,7 +474,7 @@ public class SphericalPolygonsSetTest {
           { 42.15249,  9.56001 }, { 43.00998,  9.39000 }, { 42.62812,  8.74600 }, { 42.25651,  8.54421 },
           { 41.58361,  8.77572 }, { 41.38000,  9.22975 }
         });
-        RegionFactory<Sphere2D> factory = new RegionFactory<Sphere2D>();
+        RegionFactory<Sphere2D> factory = new RegionFactory<>();
         SphericalPolygonsSet zone = (SphericalPolygonsSet) factory.union(continental, corsica);
         EnclosingBall<Sphere2D, S2Point> enclosing = zone.getEnclosingCap();
         Vector3D enclosingCenter = ((S2Point) enclosing.getCenter()).getVector();
@@ -532,7 +532,7 @@ public class SphericalPolygonsSetTest {
 
     private SubCircle create(Vector3D pole, Vector3D x, Vector3D y,
                              double tolerance, double ... limits) {
-        RegionFactory<Sphere1D> factory = new RegionFactory<Sphere1D>();
+        RegionFactory<Sphere1D> factory = new RegionFactory<>();
         Circle circle = new Circle(pole, tolerance);
         Circle phased =
                 (Circle) Circle.getTransform(new Rotation(circle.getXAxis(), circle.getYAxis(), x, y)).apply(circle);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SubCircleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SubCircleTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SubCircleTest.java
index 891f620..34b6278 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SubCircleTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/SubCircleTest.java
@@ -127,7 +127,7 @@ public class SubCircleTest {
 
     private SubCircle create(Vector3D pole, Vector3D x, Vector3D y,
                              double tolerance, double ... limits) {
-        RegionFactory<Sphere1D> factory = new RegionFactory<Sphere1D>();
+        RegionFactory<Sphere1D> factory = new RegionFactory<>();
         Circle circle = new Circle(pole, tolerance);
         Circle phased =
                 (Circle) Circle.getTransform(new Rotation(circle.getXAxis(), circle.getYAxis(), x, y)).apply(circle);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/test/java/org/apache/commons/math4/linear/ArrayFieldVectorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/ArrayFieldVectorTest.java b/src/test/java/org/apache/commons/math4/linear/ArrayFieldVectorTest.java
index a9f7ac7..1268b26 100644
--- a/src/test/java/org/apache/commons/math4/linear/ArrayFieldVectorTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/ArrayFieldVectorTest.java
@@ -139,7 +139,7 @@ public class ArrayFieldVectorTest {
             for (int i = 0; i < data.length; i++) {
                 out[i] = data[i].multiply(d);
             }
-            return new FieldVectorTestImpl<T>(out);
+            return new FieldVectorTestImpl<>(out);
         }
 
         public FieldVector<T> mapMultiplyToSelf(T d) {
@@ -263,70 +263,70 @@ public class ArrayFieldVectorTest {
     @Test
     public void testConstructors() {
 
-        ArrayFieldVector<Fraction> v0 = new ArrayFieldVector<Fraction>(FractionField.getInstance());
+        ArrayFieldVector<Fraction> v0 = new ArrayFieldVector<>(FractionField.getInstance());
         Assert.assertEquals(0, v0.getDimension());
 
-        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<Fraction>(FractionField.getInstance(), 7);
+        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<>(FractionField.getInstance(), 7);
         Assert.assertEquals(7, v1.getDimension());
         Assert.assertEquals(Fraction.ZERO, v1.getEntry(6));
 
-        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<Fraction>(5, new Fraction(123, 100));
+        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<>(5, new Fraction(123, 100));
         Assert.assertEquals(5, v2.getDimension());
         Assert.assertEquals(new Fraction(123, 100), v2.getEntry(4));
 
-        ArrayFieldVector<Fraction> v3 = new ArrayFieldVector<Fraction>(FractionField.getInstance(), vec1);
+        ArrayFieldVector<Fraction> v3 = new ArrayFieldVector<>(FractionField.getInstance(), vec1);
         Assert.assertEquals(3, v3.getDimension());
         Assert.assertEquals(new Fraction(2), v3.getEntry(1));
 
-        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<Fraction>(FractionField.getInstance(), vec4, 3, 2);
+        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<>(FractionField.getInstance(), vec4, 3, 2);
         Assert.assertEquals(2, v4.getDimension());
         Assert.assertEquals(new Fraction(4), v4.getEntry(0));
         try {
-            new ArrayFieldVector<Fraction>(vec4, 8, 3);
+            new ArrayFieldVector<>(vec4, 8, 3);
             Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
 
-        FieldVector<Fraction> v5_i = new ArrayFieldVector<Fraction>(dvec1);
+        FieldVector<Fraction> v5_i = new ArrayFieldVector<>(dvec1);
         Assert.assertEquals(9, v5_i.getDimension());
         Assert.assertEquals(new Fraction(9), v5_i.getEntry(8));
 
-        ArrayFieldVector<Fraction> v5 = new ArrayFieldVector<Fraction>(dvec1);
+        ArrayFieldVector<Fraction> v5 = new ArrayFieldVector<>(dvec1);
         Assert.assertEquals(9, v5.getDimension());
         Assert.assertEquals(new Fraction(9), v5.getEntry(8));
 
-        ArrayFieldVector<Fraction> v6 = new ArrayFieldVector<Fraction>(dvec1, 3, 2);
+        ArrayFieldVector<Fraction> v6 = new ArrayFieldVector<>(dvec1, 3, 2);
         Assert.assertEquals(2, v6.getDimension());
         Assert.assertEquals(new Fraction(4), v6.getEntry(0));
         try {
-            new ArrayFieldVector<Fraction>(dvec1, 8, 3);
+            new ArrayFieldVector<>(dvec1, 8, 3);
             Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
 
-        ArrayFieldVector<Fraction> v7 = new ArrayFieldVector<Fraction>(v1);
+        ArrayFieldVector<Fraction> v7 = new ArrayFieldVector<>(v1);
         Assert.assertEquals(7, v7.getDimension());
         Assert.assertEquals(Fraction.ZERO, v7.getEntry(6));
 
-        FieldVectorTestImpl<Fraction> v7_i = new FieldVectorTestImpl<Fraction>(vec1);
+        FieldVectorTestImpl<Fraction> v7_i = new FieldVectorTestImpl<>(vec1);
 
-        ArrayFieldVector<Fraction> v7_2 = new ArrayFieldVector<Fraction>(v7_i);
+        ArrayFieldVector<Fraction> v7_2 = new ArrayFieldVector<>(v7_i);
         Assert.assertEquals(3, v7_2.getDimension());
         Assert.assertEquals(new Fraction(2), v7_2.getEntry(1));
 
-        ArrayFieldVector<Fraction> v8 = new ArrayFieldVector<Fraction>(v1, true);
+        ArrayFieldVector<Fraction> v8 = new ArrayFieldVector<>(v1, true);
         Assert.assertEquals(7, v8.getDimension());
         Assert.assertEquals(Fraction.ZERO, v8.getEntry(6));
         Assert.assertNotSame("testData not same object ", v1.getDataRef(), v8.getDataRef());
 
-        ArrayFieldVector<Fraction> v8_2 = new ArrayFieldVector<Fraction>(v1, false);
+        ArrayFieldVector<Fraction> v8_2 = new ArrayFieldVector<>(v1, false);
         Assert.assertEquals(7, v8_2.getDimension());
         Assert.assertEquals(Fraction.ZERO, v8_2.getEntry(6));
         Assert.assertArrayEquals(v1.getDataRef(), v8_2.getDataRef());
 
-        ArrayFieldVector<Fraction> v9 = new ArrayFieldVector<Fraction>((FieldVector<Fraction>) v1, (FieldVector<Fraction>) v3);
+        ArrayFieldVector<Fraction> v9 = new ArrayFieldVector<>((FieldVector<Fraction>) v1, (FieldVector<Fraction>) v3);
         Assert.assertEquals(10, v9.getDimension());
         Assert.assertEquals(new Fraction(1), v9.getEntry(7));
 
@@ -335,10 +335,10 @@ public class ArrayFieldVectorTest {
     @Test
     public void testDataInOut() {
 
-        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<Fraction>(vec1);
-        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<Fraction>(vec2);
-        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<Fraction>(vec4);
-        FieldVectorTestImpl<Fraction> v2_t = new FieldVectorTestImpl<Fraction>(vec2);
+        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<>(vec1);
+        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<>(vec2);
+        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<>(vec4);
+        FieldVectorTestImpl<Fraction> v2_t = new FieldVectorTestImpl<>(vec2);
 
         FieldVector<Fraction> v_append_1 = v1.append(v2);
         Assert.assertEquals(6, v_append_1.getDimension());
@@ -430,7 +430,7 @@ public class ArrayFieldVectorTest {
 
     @Test
     public void testMapFunctions() {
-        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<Fraction>(vec1);
+        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<>(vec1);
 
         //octave =  v1 .+ 2.0
         FieldVector<Fraction> v_mapAdd = v1.mapAdd(new Fraction(2));
@@ -491,18 +491,18 @@ public class ArrayFieldVectorTest {
 
     @Test
     public void testBasicFunctions() {
-        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<Fraction>(vec1);
-        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<Fraction>(vec2);
-        new ArrayFieldVector<Fraction>(vec_null);
+        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<>(vec1);
+        ArrayFieldVector<Fraction> v2 = new ArrayFieldVector<>(vec2);
+        new ArrayFieldVector<>(vec_null);
 
-        FieldVectorTestImpl<Fraction> v2_t = new FieldVectorTestImpl<Fraction>(vec2);
+        FieldVectorTestImpl<Fraction> v2_t = new FieldVectorTestImpl<>(vec2);
 
         //octave =  v1 + v2
         ArrayFieldVector<Fraction> v_add = v1.add(v2);
         Fraction[] result_add = {new Fraction(5), new Fraction(7), new Fraction(9)};
         checkArray("compare vect" ,v_add.toArray(),result_add);
 
-        FieldVectorTestImpl<Fraction> vt2 = new FieldVectorTestImpl<Fraction>(vec2);
+        FieldVectorTestImpl<Fraction> vt2 = new FieldVectorTestImpl<>(vec2);
         FieldVector<Fraction> v_add_i = v1.add(vt2);
         Fraction[] result_add_i = {new Fraction(5), new Fraction(7), new Fraction(9)};
         checkArray("compare vect" ,v_add_i.toArray(),result_add_i);
@@ -560,9 +560,9 @@ public class ArrayFieldVectorTest {
 
     @Test
     public void testMisc() {
-        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<Fraction>(vec1);
-        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<Fraction>(vec4);
-        FieldVector<Fraction> v4_2 = new ArrayFieldVector<Fraction>(vec4);
+        ArrayFieldVector<Fraction> v1 = new ArrayFieldVector<>(vec1);
+        ArrayFieldVector<Fraction> v4 = new ArrayFieldVector<>(vec4);
+        FieldVector<Fraction> v4_2 = new ArrayFieldVector<>(vec4);
 
         String out1 = v1.toString();
         Assert.assertTrue("some output ",  out1.length()!=0);
@@ -596,7 +596,7 @@ public class ArrayFieldVectorTest {
 
     @Test
     public void testSerial()  {
-        ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(vec1);
+        ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(vec1);
         Assert.assertEquals(v,TestUtils.serializeAndRecover(v));
     }
 
@@ -605,40 +605,40 @@ public class ArrayFieldVectorTest {
 
         // when the field is not specified, array cannot be empty
         try {
-            new ArrayFieldVector<Fraction>(new Fraction[0]);
+            new ArrayFieldVector<>(new Fraction[0]);
             Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
         try {
-            new ArrayFieldVector<Fraction>(new Fraction[0], true);
+            new ArrayFieldVector<>(new Fraction[0], true);
             Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
         try {
-            new ArrayFieldVector<Fraction>(new Fraction[0], false);
+            new ArrayFieldVector<>(new Fraction[0], false);
             Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
 
         // when the field is specified, array can be empty
-        Assert.assertEquals(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), new Fraction[0]).getDimension());
-        Assert.assertEquals(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), new Fraction[0], true).getDimension());
-        Assert.assertEquals(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), new Fraction[0], false).getDimension());
+        Assert.assertEquals(0, new ArrayFieldVector<>(FractionField.getInstance(), new Fraction[0]).getDimension());
+        Assert.assertEquals(0, new ArrayFieldVector<>(FractionField.getInstance(), new Fraction[0], true).getDimension());
+        Assert.assertEquals(0, new ArrayFieldVector<>(FractionField.getInstance(), new Fraction[0], false).getDimension());
 
     }
 
     @Test
     public void testOuterProduct() {
         final ArrayFieldVector<Fraction> u
-            = new ArrayFieldVector<Fraction>(FractionField.getInstance(),
+            = new ArrayFieldVector<>(FractionField.getInstance(),
                                              new Fraction[] {new Fraction(1),
                                                              new Fraction(2),
                                                              new Fraction(-3)});
         final ArrayFieldVector<Fraction> v
-            = new ArrayFieldVector<Fraction>(FractionField.getInstance(),
+            = new ArrayFieldVector<>(FractionField.getInstance(),
                                              new Fraction[] {new Fraction(4),
                                                              new Fraction(-2)});
 
@@ -675,7 +675,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final FieldVectorPreservingVisitor<Fraction> visitor;
         visitor = new FieldVectorPreservingVisitor<Fraction>() {
 
@@ -762,7 +762,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final int expectedStart = 2;
         final int expectedEnd = 7;
         final FieldVectorPreservingVisitor<Fraction> visitor;
@@ -800,7 +800,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final FieldVectorPreservingVisitor<Fraction> visitor;
         visitor = new FieldVectorPreservingVisitor<Fraction>() {
             private final boolean[] visited = new boolean[data.length];
@@ -889,7 +889,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final int expectedStart = 2;
         final int expectedEnd = 7;
         final FieldVectorPreservingVisitor<Fraction> visitor;
@@ -929,7 +929,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final FieldVectorChangingVisitor<Fraction> visitor;
         visitor = new FieldVectorChangingVisitor<Fraction>() {
 
@@ -1020,7 +1020,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final int expectedStart = 2;
         final int expectedEnd = 7;
         final FieldVectorChangingVisitor<Fraction> visitor;
@@ -1062,7 +1062,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final FieldVectorChangingVisitor<Fraction> visitor;
         visitor = new FieldVectorChangingVisitor<Fraction>() {
             private final boolean[] visited = new boolean[data.length];
@@ -1155,7 +1155,7 @@ public class ArrayFieldVectorTest {
             Fraction.ZERO, Fraction.TWO, Fraction.ZERO,
             Fraction.ZERO, Fraction.ZERO, new Fraction(3)
         };
-        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<Fraction>(data);
+        final ArrayFieldVector<Fraction> v = new ArrayFieldVector<>(data);
         final int expectedStart = 2;
         final int expectedEnd = 7;
         final FieldVectorChangingVisitor<Fraction> visitor;
@@ -1196,6 +1196,6 @@ public class ArrayFieldVectorTest {
         for (int i = 0; i < n; ++i) {
             t[i] = Fraction.ZERO;
         }
-        return new ArrayFieldVector<Fraction>(t);
+        return new ArrayFieldVector<>(t);
     }
 }


Mime
View raw message