commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [07/10] [math] Remove redundant type arguments.
Date Tue, 20 Sep 2016 06:40:37 GMT
http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldStepInterpolator.java
index b4b5357..feac005 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldStepInterpolator.java
@@ -103,7 +103,7 @@ class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends Abstract
         this.scalingH  = stepSize;
         this.reference = reference;
         this.scaled    = scaled.clone();
-        this.nordsieck = new Array2DRowFieldMatrix<T>(nordsieck.getData(), false);
+        this.nordsieck = new Array2DRowFieldMatrix<>(nordsieck.getData(), false);
     }
 
     /** Create a new instance.
@@ -121,7 +121,7 @@ class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends Abstract
                                                    FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                    FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                    FieldEquationsMapper<T> newMapper) {
-        return new AdamsFieldStepInterpolator<T>(scalingH, reference, scaled, nordsieck,
+        return new AdamsFieldStepInterpolator<>(scalingH, reference, scaled, nordsieck,
                                                  newForward,
                                                  newGlobalPreviousState, newGlobalCurrentState,
                                                  newSoftPreviousState, newSoftCurrentState,
@@ -181,7 +181,7 @@ class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends Abstract
                 estimatedDerivatives[j].add(scaled[j].multiply(normalizedAbscissa)).divide(x);
         }
 
-        return new FieldODEStateAndDerivative<S>(time, estimatedState, estimatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, estimatedState, estimatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java
index c659cc0..72d4de2 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java
@@ -284,8 +284,8 @@ public class AdamsMoultonFieldIntegrator<T extends RealFieldElement<T>> extends
             updateHighOrderDerivativesPhase2(predictedScaled, correctedScaled, predictedNordsieck);
 
             // discrete events handling
-            stepEnd = new FieldODEStateAndDerivative<T>(stepEnd.getTime(), predictedY, correctedYDot);
-            setStepStart(acceptStep(new AdamsFieldStepInterpolator<T>(getStepSize(), stepEnd,
+            stepEnd = new FieldODEStateAndDerivative<>(stepEnd.getTime(), predictedY, correctedYDot);
+            setStepStart(acceptStep(new AdamsFieldStepInterpolator<>(getStepSize(), stepEnd,
                                                                       correctedScaled, predictedNordsieck, forward,
                                                                       getStepStart(), stepEnd,
                                                                       equations.getMapper()),

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java
index c1e5bee..7c2b872 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java
@@ -137,8 +137,7 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
     private static final Map<Integer,
                          Map<Field<? extends RealFieldElement<?>>,
                                    AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>> CACHE =
-        new HashMap<Integer, Map<Field<? extends RealFieldElement<?>>,
-                                 AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>>();
+        new HashMap<>();
 
     /** Field to which the time and state vector elements belong. */
     private final Field<T> field;
@@ -162,11 +161,11 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
         // compute coefficients
         FieldMatrix<T> bigP = buildP(rows);
         FieldDecompositionSolver<T> pSolver =
-            new FieldLUDecomposition<T>(bigP).getSolver();
+            new FieldLUDecomposition<>(bigP).getSolver();
 
         T[] u = MathArrays.buildArray(field, rows);
         Arrays.fill(u, field.getOne());
-        c1 = pSolver.solve(new ArrayFieldVector<T>(u, false)).toArray();
+        c1 = pSolver.solve(new ArrayFieldVector<>(u, false)).toArray();
 
         // update coefficients are computed by combining transform from
         // Nordsieck to multistep, then shifting rows to represent step advance
@@ -178,7 +177,7 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
         }
         shiftedP[0] = MathArrays.buildArray(field, rows);
         Arrays.fill(shiftedP[0], field.getZero());
-        update = new Array2DRowFieldMatrix<T>(pSolver.solve(new Array2DRowFieldMatrix<T>(shiftedP, false)).getData());
+        update = new Array2DRowFieldMatrix<>(pSolver.solve(new Array2DRowFieldMatrix<>(shiftedP, false)).getData());
 
     }
 
@@ -195,14 +194,13 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
             Map<Field<? extends RealFieldElement<?>>,
                       AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>> map = CACHE.get(nSteps);
             if (map == null) {
-                map = new HashMap<Field<? extends RealFieldElement<?>>,
-                                        AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>();
+                map = new HashMap<>();
                 CACHE.put(nSteps, map);
             }
             @SuppressWarnings("unchecked")
             AdamsNordsieckFieldTransformer<T> t = (AdamsNordsieckFieldTransformer<T>) map.get(field);
             if (t == null) {
-                t = new AdamsNordsieckFieldTransformer<T>(field, nSteps);
+                t = new AdamsNordsieckFieldTransformer<>(field, nSteps);
                 map.put(field, t);
             }
             return t;
@@ -239,7 +237,7 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
             }
         }
 
-        return new Array2DRowFieldMatrix<T>(pData, false);
+        return new Array2DRowFieldMatrix<>(pData, false);
 
     }
 
@@ -303,12 +301,12 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
 
         // solve the linear system to get the best estimate of the Nordsieck vector [s2 ... sk],
         // with the additional terms s(k+1) and c grabbing the parts after the truncated Taylor expansion
-        final FieldLUDecomposition<T> decomposition = new FieldLUDecomposition<T>(new Array2DRowFieldMatrix<T>(a, false));
-        final FieldMatrix<T> x = decomposition.getSolver().solve(new Array2DRowFieldMatrix<T>(b, false));
+        final FieldLUDecomposition<T> decomposition = new FieldLUDecomposition<>(new Array2DRowFieldMatrix<>(a, false));
+        final FieldMatrix<T> x = decomposition.getSolver().solve(new Array2DRowFieldMatrix<>(b, false));
 
         // extract just the Nordsieck vector [s2 ... sk]
         final Array2DRowFieldMatrix<T> truncatedX =
-                        new Array2DRowFieldMatrix<T>(field, x.getRowDimension() - 1, x.getColumnDimension());
+                        new Array2DRowFieldMatrix<>(field, x.getRowDimension() - 1, x.getColumnDimension());
         for (int i = 0; i < truncatedX.getRowDimension(); ++i) {
             for (int j = 0; j < truncatedX.getColumnDimension(); ++j) {
                 truncatedX.setEntry(i, j, x.getEntry(i, j));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java
index 86bc871..f38e61a 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java
@@ -136,7 +136,7 @@ public class AdamsNordsieckTransformer {
 
     /** Cache for already computed coefficients. */
     private static final Map<Integer, AdamsNordsieckTransformer> CACHE =
-        new HashMap<Integer, AdamsNordsieckTransformer>();
+        new HashMap<>();
 
     /** Update matrix for the higher order derivatives h<sup>2</sup>/2 y'', h<sup>3</sup>/6 y''' ... */
     private final Array2DRowRealMatrix update;
@@ -155,11 +155,11 @@ public class AdamsNordsieckTransformer {
         // compute exact coefficients
         FieldMatrix<BigFraction> bigP = buildP(rows);
         FieldDecompositionSolver<BigFraction> pSolver =
-            new FieldLUDecomposition<BigFraction>(bigP).getSolver();
+            new FieldLUDecomposition<>(bigP).getSolver();
 
         BigFraction[] u = new BigFraction[rows];
         Arrays.fill(u, BigFraction.ONE);
-        BigFraction[] bigC1 = pSolver.solve(new ArrayFieldVector<BigFraction>(u, false)).toArray();
+        BigFraction[] bigC1 = pSolver.solve(new ArrayFieldVector<>(u, false)).toArray();
 
         // update coefficients are computed by combining transform from
         // Nordsieck to multistep, then shifting rows to represent step advance
@@ -172,7 +172,7 @@ public class AdamsNordsieckTransformer {
         shiftedP[0] = new BigFraction[rows];
         Arrays.fill(shiftedP[0], BigFraction.ZERO);
         FieldMatrix<BigFraction> bigMSupdate =
-            pSolver.solve(new Array2DRowFieldMatrix<BigFraction>(shiftedP, false));
+            pSolver.solve(new Array2DRowFieldMatrix<>(shiftedP, false));
 
         // convert coefficients to double
         update         = MatrixUtils.bigFractionMatrixToRealMatrix(bigMSupdate);
@@ -239,7 +239,7 @@ public class AdamsNordsieckTransformer {
             }
         }
 
-        return new Array2DRowFieldMatrix<BigFraction>(pData, false);
+        return new Array2DRowFieldMatrix<>(pData, false);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java
index 315924a..56add60 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java
@@ -105,7 +105,7 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new ClassicalRungeKuttaFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new ClassicalRungeKuttaFieldStepInterpolator<>(getField(), forward, yDotK,
                                                                globalPreviousState, globalCurrentState,
                                                                globalPreviousState, globalCurrentState,
                                                                mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java
index 522530b..c4d1263 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java
@@ -89,7 +89,7 @@ class ClassicalRungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
                                                                  final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                                  final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                                  final FieldEquationsMapper<T> newMapper) {
-        return new ClassicalRungeKuttaFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new ClassicalRungeKuttaFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                                newGlobalPreviousState, newGlobalCurrentState,
                                                                newSoftPreviousState, newSoftCurrentState,
                                                                newMapper);
@@ -129,7 +129,7 @@ class ClassicalRungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot1, coeffDot23, coeffDot23, coeffDot4);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java
index b8ec110..12d7a64 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java
@@ -193,7 +193,7 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
         createInterpolator(final boolean forward, T[][] yDotK,
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState, final FieldEquationsMapper<T> mapper) {
-        return new DormandPrince54FieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new DormandPrince54FieldStepInterpolator<>(getField(), forward, yDotK,
                                                            globalPreviousState, globalCurrentState,
                                                            globalPreviousState, globalCurrentState,
                                                            mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldStepInterpolator.java
index 16a2fe4..61548ce 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldStepInterpolator.java
@@ -114,7 +114,7 @@ class DormandPrince54FieldStepInterpolator<T extends RealFieldElement<T>>
                                                                  final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                                  final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                                  final FieldEquationsMapper<T> newMapper) {
-        return new DormandPrince54FieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new DormandPrince54FieldStepInterpolator<>(newField, newForward, newYDotK,
                                                            newGlobalPreviousState, newGlobalCurrentState,
                                                            newSoftPreviousState, newSoftCurrentState,
                                                            newMapper);
@@ -242,7 +242,7 @@ class DormandPrince54FieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot0, coeffDot1, coeffDot2, coeffDot3,
                                                                   coeffDot4, coeffDot5, coeffDot6);
         }
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldIntegrator.java
index 171b465..b40eb50 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldIntegrator.java
@@ -399,7 +399,7 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
         createInterpolator(final boolean forward, T[][] yDotK,
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState, final FieldEquationsMapper<T> mapper) {
-        return new DormandPrince853FieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new DormandPrince853FieldStepInterpolator<>(getField(), forward, yDotK,
                                                             globalPreviousState, globalCurrentState,
                                                             globalPreviousState, globalCurrentState,
                                                             mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldStepInterpolator.java
index e4d7ee5..5228dd2 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince853FieldStepInterpolator.java
@@ -195,7 +195,7 @@ class DormandPrince853FieldStepInterpolator<T extends RealFieldElement<T>>
                                                                final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                                final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                                final FieldEquationsMapper<T> newMapper) {
-        return new DormandPrince853FieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new DormandPrince853FieldStepInterpolator<>(newField, newForward, newYDotK,
                                                             newGlobalPreviousState, newGlobalCurrentState,
                                                             newSoftPreviousState, newSoftCurrentState,
                                                             newMapper);
@@ -295,7 +295,7 @@ class DormandPrince853FieldStepInterpolator<T extends RealFieldElement<T>>
                                                                   q[8], q[9], q[10], q[11], q[12], q[13], q[14], q[15]);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
index acba7a5..6238953 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
@@ -309,7 +309,7 @@ public abstract class EmbeddedRungeKuttaFieldIntegrator<T extends RealFieldEleme
             }
             final T   stepEnd = getStepStart().getTime().add(getStepSize());
             final T[] yDotTmp = (fsal >= 0) ? yDotK[fsal] : computeDerivatives(stepEnd, yTmp);
-            final FieldODEStateAndDerivative<T> stateTmp = new FieldODEStateAndDerivative<T>(stepEnd, yTmp, yDotTmp);
+            final FieldODEStateAndDerivative<T> stateTmp = new FieldODEStateAndDerivative<>(stepEnd, yTmp, yDotTmp);
 
             // local error is small enough: accept the step, trigger events and step handlers
             System.arraycopy(yTmp, 0, y, 0, y0.length);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldIntegrator.java
index ce87431..503231c 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldIntegrator.java
@@ -90,7 +90,7 @@ public class EulerFieldIntegrator<T extends RealFieldElement<T>> extends RungeKu
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new EulerFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new EulerFieldStepInterpolator<>(getField(), forward, yDotK,
                                                  globalPreviousState, globalCurrentState,
                                                  globalPreviousState, globalCurrentState,
                                                  mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java
index e57865a..43b8a53 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java
@@ -79,7 +79,7 @@ class EulerFieldStepInterpolator<T extends RealFieldElement<T>>
                                                                  final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                                  final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                                  final FieldEquationsMapper<T> newMapper) {
-        return new EulerFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new EulerFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                  newGlobalPreviousState, newGlobalCurrentState,
                                                  newSoftPreviousState, newSoftCurrentState,
                                                  newMapper);
@@ -101,7 +101,7 @@ class EulerFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(time.getField().getOne());
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java
index 1fc6688..0ee8b5d 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java
@@ -115,7 +115,7 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new GillFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new GillFieldStepInterpolator<>(getField(), forward, yDotK,
                                                 globalPreviousState, globalCurrentState,
                                                 globalPreviousState, globalCurrentState,
                                                 mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java
index bb00d04..df47430 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java
@@ -97,7 +97,7 @@ class GillFieldStepInterpolator<T extends RealFieldElement<T>>
                                                   final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                   final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                   final FieldEquationsMapper<T> newMapper) {
-        return new GillFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new GillFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                 newGlobalPreviousState, newGlobalCurrentState,
                                                 newSoftPreviousState, newSoftCurrentState,
                                                 newMapper);
@@ -141,7 +141,7 @@ class GillFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot1, coeffDot2, coeffDot3, coeffDot4);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldIntegrator.java
index 0f8353a..e88467e 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldIntegrator.java
@@ -168,7 +168,7 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
         createInterpolator(final boolean forward, T[][] yDotK,
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState, final FieldEquationsMapper<T> mapper) {
-        return new HighamHall54FieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new HighamHall54FieldStepInterpolator<>(getField(), forward, yDotK,
                                                         globalPreviousState, globalCurrentState,
                                                         globalPreviousState, globalCurrentState,
                                                         mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldStepInterpolator.java
index a915e26..fd8f5cf 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/HighamHall54FieldStepInterpolator.java
@@ -65,7 +65,7 @@ class HighamHall54FieldStepInterpolator<T extends RealFieldElement<T>>
                                                           final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                           final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                           final FieldEquationsMapper<T> newMapper) {
-        return new HighamHall54FieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new HighamHall54FieldStepInterpolator<>(newField, newForward, newYDotK,
                                                         newGlobalPreviousState, newGlobalCurrentState,
                                                         newSoftPreviousState, newSoftCurrentState,
                                                         newMapper);
@@ -109,7 +109,7 @@ class HighamHall54FieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(bDot0, bDot1, bDot2, bDot3, bDot4, bDot5);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java
index 1c3301c..b3c1424 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java
@@ -140,7 +140,7 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new LutherFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new LutherFieldStepInterpolator<>(getField(), forward, yDotK,
                                                   globalPreviousState, globalCurrentState,
                                                   globalPreviousState, globalCurrentState,
                                                   mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldStepInterpolator.java
index 438e09e..df5ea6a 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldStepInterpolator.java
@@ -125,7 +125,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
                                                     final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                     final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                     final FieldEquationsMapper<T> newMapper) {
-        return new LutherFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new LutherFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                   newGlobalPreviousState, newGlobalCurrentState,
                                                   newSoftPreviousState, newSoftCurrentState,
                                                   newMapper);
@@ -217,7 +217,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot1, coeffDot2, coeffDot3, coeffDot4, coeffDot5, coeffDot6, coeffDot7);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java
index af5a867..3b604e3 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java
@@ -90,7 +90,7 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new MidpointFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new MidpointFieldStepInterpolator<>(getField(), forward, yDotK,
                                                     globalPreviousState, globalCurrentState,
                                                     globalPreviousState, globalCurrentState,
                                                     mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java
index 03bd70d..f64012e 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java
@@ -81,7 +81,7 @@ class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>
                                                       final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                       final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                       final FieldEquationsMapper<T> newMapper) {
-        return new MidpointFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new MidpointFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                     newGlobalPreviousState, newGlobalCurrentState,
                                                     newSoftPreviousState, newSoftCurrentState,
                                                     newMapper);
@@ -111,7 +111,7 @@ class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot1, coeffDot2);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java
index 8956fa4..f07bbae 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java
@@ -177,7 +177,7 @@ public abstract class RungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
             }
             final T stepEnd   = getStepStart().getTime().add(getStepSize());
             final T[] yDotTmp = computeDerivatives(stepEnd, yTmp);
-            final FieldODEStateAndDerivative<T> stateTmp = new FieldODEStateAndDerivative<T>(stepEnd, yTmp, yDotTmp);
+            final FieldODEStateAndDerivative<T> stateTmp = new FieldODEStateAndDerivative<>(stepEnd, yTmp, yDotTmp);
 
             // discrete events handling
             System.arraycopy(yTmp, 0, y, 0, y0.length);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java
index 4a786f5..8169d75 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java
@@ -104,7 +104,7 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
                            final FieldODEStateAndDerivative<T> globalPreviousState,
                            final FieldODEStateAndDerivative<T> globalCurrentState,
                            final FieldEquationsMapper<T> mapper) {
-        return new ThreeEighthesFieldStepInterpolator<T>(getField(), forward, yDotK,
+        return new ThreeEighthesFieldStepInterpolator<>(getField(), forward, yDotK,
                                                          globalPreviousState, globalCurrentState,
                                                          globalPreviousState, globalCurrentState,
                                                          mapper);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java
index 69df7f8..b41f91a 100644
--- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java
@@ -91,7 +91,7 @@ class ThreeEighthesFieldStepInterpolator<T extends RealFieldElement<T>>
                                                            final FieldODEStateAndDerivative<T> newSoftPreviousState,
                                                            final FieldODEStateAndDerivative<T> newSoftCurrentState,
                                                            final FieldEquationsMapper<T> newMapper) {
-        return new ThreeEighthesFieldStepInterpolator<T>(newField, newForward, newYDotK,
+        return new ThreeEighthesFieldStepInterpolator<>(newField, newForward, newYDotK,
                                                          newGlobalPreviousState, newGlobalCurrentState,
                                                          newSoftPreviousState, newSoftCurrentState,
                                                          newMapper);
@@ -132,7 +132,7 @@ class ThreeEighthesFieldStepInterpolator<T extends RealFieldElement<T>>
             interpolatedDerivatives = derivativeLinearCombination(coeffDot1, coeffDot2, coeffDot3, coeffDot4);
         }
 
-        return new FieldODEStateAndDerivative<T>(time, interpolatedState, interpolatedDerivatives);
+        return new FieldODEStateAndDerivative<>(time, interpolatedState, interpolatedDerivatives);
 
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraintSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraintSet.java b/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraintSet.java
index 7a31698..3dcc2a1 100644
--- a/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraintSet.java
+++ b/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraintSet.java
@@ -30,7 +30,7 @@ import org.apache.commons.math4.optim.OptimizationData;
  */
 public class LinearConstraintSet implements OptimizationData {
     /** Set of constraints. */
-    private final Set<LinearConstraint> linearConstraints = new LinkedHashSet<LinearConstraint>();
+    private final Set<LinearConstraint> linearConstraints = new LinkedHashSet<>();
 
     /**
      * Creates a set containing the given constraints.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/optim/linear/SimplexSolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/optim/linear/SimplexSolver.java b/src/main/java/org/apache/commons/math4/optim/linear/SimplexSolver.java
index a835765..04b6ab9 100644
--- a/src/main/java/org/apache/commons/math4/optim/linear/SimplexSolver.java
+++ b/src/main/java/org/apache/commons/math4/optim/linear/SimplexSolver.java
@@ -247,7 +247,7 @@ public class SimplexSolver extends LinearOptimizer {
      */
     private Integer getPivotRow(SimplexTableau tableau, final int col) {
         // create a list of all the rows that tie for the lowest score in the minimum ratio test
-        List<Integer> minRatioPositions = new ArrayList<Integer>();
+        List<Integer> minRatioPositions = new ArrayList<>();
         double minRatio = Double.MAX_VALUE;
         for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getHeight(); i++) {
             final double rhs = tableau.getEntry(i, tableau.getWidth() - 1);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java b/src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java
index 7d6c8f0..02ee664 100644
--- a/src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java
+++ b/src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java
@@ -78,7 +78,7 @@ class SimplexTableau implements Serializable {
     private final boolean restrictToNonNegative;
 
     /** The variables each column represents */
-    private final List<String> columnLabels = new ArrayList<String>();
+    private final List<String> columnLabels = new ArrayList<>();
 
     /** Simple tableau. */
     private transient Array2DRowRealMatrix tableau;
@@ -272,7 +272,7 @@ class SimplexTableau implements Serializable {
      * @return new versions of the constraints
      */
     public List<LinearConstraint> normalizeConstraints(Collection<LinearConstraint> originalConstraints) {
-        List<LinearConstraint> normalized = new ArrayList<LinearConstraint>(originalConstraints.size());
+        List<LinearConstraint> normalized = new ArrayList<>(originalConstraints.size());
         for (LinearConstraint constraint : originalConstraints) {
             normalized.add(normalize(constraint));
         }
@@ -395,7 +395,7 @@ class SimplexTableau implements Serializable {
             return;
         }
 
-        final Set<Integer> columnsToDrop = new TreeSet<Integer>();
+        final Set<Integer> columnsToDrop = new TreeSet<>();
         columnsToDrop.add(0);
 
         // positive cost non-artificial variables
@@ -469,7 +469,7 @@ class SimplexTableau implements Serializable {
         Integer negativeVarBasicRow = negativeVarColumn > 0 ? getBasicRow(negativeVarColumn) : null;
         double mostNegative = negativeVarBasicRow == null ? 0 : getEntry(negativeVarBasicRow, getRhsOffset());
 
-        final Set<Integer> usedBasicRows = new HashSet<Integer>();
+        final Set<Integer> usedBasicRows = new HashSet<>();
         final double[] coefficients = new double[getOriginalNumDecisionVariables()];
         for (int i = 0; i < coefficients.length; i++) {
             int colIndex = columnLabels.indexOf("x" + i);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
index d059868..49bf465 100644
--- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
+++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
@@ -41,7 +41,7 @@ public class MultiStartMultivariateOptimizer
     /** Underlying optimizer. */
     private final MultivariateOptimizer optimizer;
     /** Found optima. */
-    private final List<PointValuePair> optima = new ArrayList<PointValuePair>();
+    private final List<PointValuePair> optima = new ArrayList<>();
 
     /**
      * Create a multi-start optimizer from a single-start optimizer.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
index 727fd18..2a62609 100644
--- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
+++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
@@ -199,13 +199,13 @@ public class CMAESOptimizer
     private final RandomGenerator random;
 
     /** History of sigma values. */
-    private final List<Double> statisticsSigmaHistory = new ArrayList<Double>();
+    private final List<Double> statisticsSigmaHistory = new ArrayList<>();
     /** History of mean matrix. */
-    private final List<RealMatrix> statisticsMeanHistory = new ArrayList<RealMatrix>();
+    private final List<RealMatrix> statisticsMeanHistory = new ArrayList<>();
     /** History of fitness values. */
-    private final List<Double> statisticsFitnessHistory = new ArrayList<Double>();
+    private final List<Double> statisticsFitnessHistory = new ArrayList<>();
     /** History of D matrix. */
-    private final List<RealMatrix> statisticsDHistory = new ArrayList<RealMatrix>();
+    private final List<RealMatrix> statisticsDHistory = new ArrayList<>();
 
     /**
      * @param maxIterations Maximal number of iterations.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/primes/SmallPrimes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/primes/SmallPrimes.java b/src/main/java/org/apache/commons/math4/primes/SmallPrimes.java
index 0738cd2..6f329e3 100644
--- a/src/main/java/org/apache/commons/math4/primes/SmallPrimes.java
+++ b/src/main/java/org/apache/commons/math4/primes/SmallPrimes.java
@@ -125,7 +125,7 @@ class SmallPrimes {
      * @return the list of prime factors of n
      */
     public static List<Integer> trialDivision(int n){
-        final List<Integer> factors = new ArrayList<Integer>(32);
+        final List<Integer> factors = new ArrayList<>(32);
         n = smallTrialDivision(n, factors);
         if (1 == n) {
             return factors;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/random/EmpiricalDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/random/EmpiricalDistribution.java b/src/main/java/org/apache/commons/math4/random/EmpiricalDistribution.java
index 6d2722e..f774ce3 100644
--- a/src/main/java/org/apache/commons/math4/random/EmpiricalDistribution.java
+++ b/src/main/java/org/apache/commons/math4/random/EmpiricalDistribution.java
@@ -195,7 +195,7 @@ public class EmpiricalDistribution extends AbstractRealDistribution {
         }
         this.binCount = binCount;
         this.randomData = randomData;
-        binStats = new ArrayList<SummaryStatistics>();
+        binStats = new ArrayList<>();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/Frequency.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/Frequency.java b/src/main/java/org/apache/commons/math4/stat/Frequency.java
index d032c75..f676720 100644
--- a/src/main/java/org/apache/commons/math4/stat/Frequency.java
+++ b/src/main/java/org/apache/commons/math4/stat/Frequency.java
@@ -74,7 +74,7 @@ public class Frequency implements Serializable {
      * Default constructor.
      */
     public Frequency() {
-        freqTable = new TreeMap<Comparable<?>, Long>();
+        freqTable = new TreeMap<>();
     }
 
     /**
@@ -84,7 +84,7 @@ public class Frequency implements Serializable {
      */
     @SuppressWarnings("unchecked") // TODO is the cast OK?
     public Frequency(Comparator<?> comparator) {
-        freqTable = new TreeMap<Comparable<?>, Long>((Comparator<? super Comparable<?>>) comparator);
+        freqTable = new TreeMap<>((Comparator<? super Comparable<?>>) comparator);
     }
 
     /**
@@ -574,7 +574,7 @@ public class Frequency implements Serializable {
             }
         }
 
-        List<Comparable<?>> modeList = new ArrayList<Comparable<?>>();
+        List<Comparable<?>> modeList = new ArrayList<>();
         for (Entry<Comparable<?>, Long> ent : freqTable.entrySet()) {
             long frequency = ent.getValue().longValue();
             if (frequency == mostPopular) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
index 8df17ea..32ed6d0 100644
--- a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
+++ b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
@@ -164,7 +164,7 @@ public class KendallsCorrelation {
         @SuppressWarnings("unchecked")
         Pair<Double, Double>[] pairs = new Pair[n];
         for (int i = 0; i < n; i++) {
-            pairs[i] = new Pair<Double, Double>(xArray[i], yArray[i]);
+            pairs[i] = new Pair<>(xArray[i], yArray[i]);
         }
 
         Arrays.sort(pairs, new Comparator<Pair<Double, Double>>() {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
index 7ba2d16..c81a4d1 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
@@ -81,7 +81,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
      * Initial list of 5 numbers corresponding to 5 markers. <b>NOTE:</b>watch
      * out for the add methods that are overloaded
      */
-    private final List<Double> initialFive = new FixedCapacityList<Double>(PSQUARE_CONSTANT);
+    private final List<Double> initialFive = new FixedCapacityList<>(PSQUARE_CONSTANT);
 
     /**
      * The quantile needed should be in range of 0-1. The constructor

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
index 04296a3..b331ff5 100644
--- a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
+++ b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
@@ -821,7 +821,7 @@ public class KolmogorovSmirnovTest {
                 }
             }
         }
-        return new Array2DRowFieldMatrix<BigFraction>(BigFractionField.getInstance(), Hdata);
+        return new Array2DRowFieldMatrix<>(BigFractionField.getInstance(), Hdata);
     }
 
     /***
@@ -1181,7 +1181,7 @@ public class KolmogorovSmirnovTest {
      * @return true if x and y together contain ties
      */
     private static boolean hasTies(double[] x, double[] y) {
-        final HashSet<Double> values = new HashSet<Double>();
+        final HashSet<Double> values = new HashSet<>();
             for (int i = 0; i < x.length; i++) {
                 if (!values.add(x[i])) {
                     return true;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java b/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java
index 90f4e96..5afaa4a 100644
--- a/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java
+++ b/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java
@@ -195,7 +195,7 @@ public class OneWayAnova {
         MathUtils.checkNotNull(categoryData);
 
         final Collection<SummaryStatistics> categoryDataSummaryStatistics =
-                new ArrayList<SummaryStatistics>(categoryData.size());
+                new ArrayList<>(categoryData.size());
 
         // convert arrays to SummaryStatistics
         for (final double[] data : categoryData) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
index d6efc09..e301959 100644
--- a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
+++ b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
@@ -230,7 +230,7 @@ public class NaturalRanking implements RankingAlgorithm {
         double[] out = new double[ranks.length];
         int pos = 1;  // position in sorted array
         out[ranks[0].getPosition()] = pos;
-        List<Integer> tiesTrace = new ArrayList<Integer>();
+        List<Integer> tiesTrace = new ArrayList<>();
         tiesTrace.add(ranks[0].getPosition());
         for (int i = 1; i < ranks.length; i++) {
             if (Double.compare(ranks[i].getValue(), ranks[i - 1].getValue()) > 0) {
@@ -239,7 +239,7 @@ public class NaturalRanking implements RankingAlgorithm {
                 if (tiesTrace.size() > 1) {  // if seq is nontrivial, resolve
                     resolveTie(out, tiesTrace);
                 }
-                tiesTrace = new ArrayList<Integer>();
+                tiesTrace = new ArrayList<>();
                 tiesTrace.add(ranks[i].getPosition());
             } else {
                 // tie sequence continues
@@ -410,7 +410,7 @@ public class NaturalRanking implements RankingAlgorithm {
      * @return list of indexes i such that <code>ranks[i] = NaN</code>
      */
     private List<Integer> getNanPositions(IntDoublePair[] ranks) {
-        ArrayList<Integer> out = new ArrayList<Integer>();
+        ArrayList<Integer> out = new ArrayList<>();
         for (int i = 0; i < ranks.length; i++) {
             if (Double.isNaN(ranks[i].getValue())) {
                 out.add(Integer.valueOf(i));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java b/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java
index 08a9829..0594dee 100644
--- a/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java
+++ b/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java
@@ -43,7 +43,7 @@ public final class CombinatoricsUtils {
         6402373705728000l, 121645100408832000l, 2432902008176640000l };
 
     /** Stirling numbers of the second kind. */
-    static final AtomicReference<long[][]> STIRLING_S2 = new AtomicReference<long[][]> (null);
+    static final AtomicReference<long[][]> STIRLING_S2 = new AtomicReference<> (null);
 
     /**
      * Default implementation of {@link #factorialLog(int)} method:

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/util/IterationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/IterationManager.java b/src/main/java/org/apache/commons/math4/util/IterationManager.java
index 4437a8f..550bd25 100644
--- a/src/main/java/org/apache/commons/math4/util/IterationManager.java
+++ b/src/main/java/org/apache/commons/math4/util/IterationManager.java
@@ -43,7 +43,7 @@ public class IterationManager {
      */
     public IterationManager(final int maxIterations) {
         this.iterations = new Incrementor(maxIterations);
-        this.listeners = new CopyOnWriteArrayList<IterationListener>();
+        this.listeners = new CopyOnWriteArrayList<>();
     }
 
     /**
@@ -58,7 +58,7 @@ public class IterationManager {
     public IterationManager(final int maxIterations,
                             final Incrementor.MaxCountExceededCallback callBack) {
         this.iterations = new Incrementor(maxIterations, callBack);
-        this.listeners = new CopyOnWriteArrayList<IterationListener>();
+        this.listeners = new CopyOnWriteArrayList<>();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/util/MathArrays.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/MathArrays.java b/src/main/java/org/apache/commons/math4/util/MathArrays.java
index c50f44c..8c850db 100644
--- a/src/main/java/org/apache/commons/math4/util/MathArrays.java
+++ b/src/main/java/org/apache/commons/math4/util/MathArrays.java
@@ -844,7 +844,7 @@ public class MathArrays {
 
         // Associate each abscissa "x[i]" with its index "i".
         final List<PairDoubleInteger> list
-            = new ArrayList<PairDoubleInteger>(len);
+            = new ArrayList<>(len);
         for (int i = 0; i < len; i++) {
             list.add(new PairDoubleInteger(x[i], i));
         }
@@ -1921,7 +1921,7 @@ public class MathArrays {
      * @since 3.6
      */
     public static double[] unique(double[] data) {
-        TreeSet<Double> values = new TreeSet<Double>();
+        TreeSet<Double> values = new TreeSet<>();
         for (int i = 0; i < data.length; i++) {
             values.add(data[i]);
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/util/Pair.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/Pair.java b/src/main/java/org/apache/commons/math4/util/Pair.java
index 487cdce..f56de9b 100644
--- a/src/main/java/org/apache/commons/math4/util/Pair.java
+++ b/src/main/java/org/apache/commons/math4/util/Pair.java
@@ -151,6 +151,6 @@ public class Pair<K, V> {
      * @since 3.3
      */
     public static <K, V> Pair<K, V> create(K k, V v) {
-        return new Pair<K, V>(k, v);
+        return new Pair<>(k, v);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/main/java/org/apache/commons/math4/util/TransformerMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/TransformerMap.java b/src/main/java/org/apache/commons/math4/util/TransformerMap.java
index 374b9f6..78bb86c 100644
--- a/src/main/java/org/apache/commons/math4/util/TransformerMap.java
+++ b/src/main/java/org/apache/commons/math4/util/TransformerMap.java
@@ -49,7 +49,7 @@ public class TransformerMap implements NumberTransformer, Serializable {
      * Build a map containing only the default transformer.
      */
     public TransformerMap() {
-        map = new HashMap<Class<?>, NumberTransformer>();
+        map = new HashMap<>();
         defaultTransformer = new DefaultTransformer();
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/differentiation/DSCompilerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/differentiation/DSCompilerTest.java b/src/test/java/org/apache/commons/math4/analysis/differentiation/DSCompilerTest.java
index e54d7a3..4284505 100644
--- a/src/test/java/org/apache/commons/math4/analysis/differentiation/DSCompilerTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/differentiation/DSCompilerTest.java
@@ -155,7 +155,7 @@ public class DSCompilerTest {
     @Test public void testMultiplicationRules()
         throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
 
-        Map<String,String> referenceRules = new HashMap<String, String>();
+        Map<String,String> referenceRules = new HashMap<>();
         referenceRules.put("(f*g)",          "f * g");
         referenceRules.put("d(f*g)/dx",      "f * dg/dx + df/dx * g");
         referenceRules.put("d(f*g)/dy",      referenceRules.get("d(f*g)/dx").replaceAll("x", "y"));
@@ -246,7 +246,7 @@ public class DSCompilerTest {
 
         // the following reference rules have all been computed independently from the library,
         // using only pencil and paper and some search and replace to handle symmetries
-        Map<String,String> referenceRules = new HashMap<String, String>();
+        Map<String,String> referenceRules = new HashMap<>();
         referenceRules.put("(f(g))",              "(f(g))");
         referenceRules.put("d(f(g))/dx",          "d(f(g))/dg * dg/dx");
         referenceRules.put("d(f(g))/dy",          referenceRules.get("d(f(g))/dx").replaceAll("x", "y"));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactoryTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactoryTest.java
index 89c05de..6eda161 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactoryTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactoryTest.java
@@ -51,7 +51,7 @@ public class BaseRuleFactoryTest {
                                      new ArrayBlockingQueue<Runnable>(2));
 
         final List<Future<Pair<double[], double[]>>> results
-            = new ArrayList<Future<Pair<double[], double[]>>>();
+            = new ArrayList<>();
         for (int i = 0; i < numTasks; i++) {
             results.add(exec.submit(new RuleBuilder()));
         }
@@ -103,7 +103,7 @@ class DummyRuleFactory extends BaseRuleFactory<Double> {
             p[i] = new Double(i);
             w[i] = new Double(i);
         }
-        return new Pair<Double[], Double[]>(p, w);
+        return new Pair<>(p, w);
     }
 
     public int getNumberOfCalls() {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorTest.java
index 8270d3b..07e0675 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorTest.java
@@ -34,7 +34,7 @@ public class GaussIntegratorTest {
         final double[] weights = { 9.8, 7.6, 5.4 };
 
         final GaussIntegrator integrator
-            = new GaussIntegrator(new Pair<double[], double[]>(points, weights));
+            = new GaussIntegrator(new Pair<>(points, weights));
 
         Assert.assertEquals(weights.length, integrator.getNumberOfPoints());
 
@@ -49,7 +49,7 @@ public class GaussIntegratorTest {
         final double[] weights = { 9.8, 7.6, 5.4 };
 
         final GaussIntegrator integrator
-            = new GaussIntegrator(new Pair<double[], double[]>(points, weights));
+            = new GaussIntegrator(new Pair<>(points, weights));
 
         Assert.assertEquals(points.length, integrator.getNumberOfPoints());
 
@@ -64,7 +64,7 @@ public class GaussIntegratorTest {
         final double[] weights = { 1, 1, 1, 1, 1, 1 };
 
         final GaussIntegrator integrator
-            = new GaussIntegrator(new Pair<double[], double[]>(points, weights));
+            = new GaussIntegrator(new Pair<>(points, weights));
 
         final double val = 123.456;
         final UnivariateFunction c = new Constant(val);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/integration/gauss/HermiteParametricTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/HermiteParametricTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/HermiteParametricTest.java
index 8eb304f..5bba84e 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/HermiteParametricTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/HermiteParametricTest.java
@@ -72,7 +72,7 @@ public class HermiteParametricTest extends GaussianQuadratureAbstractTest {
     @SuppressWarnings("boxing") // OK here
     @Parameters
     public static Collection<Object[]> getParameters() {
-        final ArrayList<Object[]> parameters = new ArrayList<Object[]>();
+        final ArrayList<Object[]> parameters = new ArrayList<>();
         for (int k = 1; k <= MAX_NUM_POINTS; k++) {
             parameters.add(new Object[] { k, 2 * k - 1, Math.ulp(1d), 195 });
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionParametricTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionParametricTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionParametricTest.java
index 976488f..896f8e0 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionParametricTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionParametricTest.java
@@ -70,7 +70,7 @@ public class LegendreHighPrecisionParametricTest extends GaussianQuadratureAbstr
     @SuppressWarnings("boxing") // OK here
     @Parameters
     public static Collection<Object[]> getParameters() {
-        final ArrayList<Object[]> parameters = new ArrayList<Object[]>();
+        final ArrayList<Object[]> parameters = new ArrayList<>();
         for (int k = 1; k <= MAX_NUM_POINTS; k++) {
             parameters.add(new Object[] { k, 2 * k - 1, Math.ulp(1d), 13d });
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreParametricTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreParametricTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreParametricTest.java
index 3f0fc63..8126111 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreParametricTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/gauss/LegendreParametricTest.java
@@ -70,7 +70,7 @@ public class LegendreParametricTest extends GaussianQuadratureAbstractTest {
     @SuppressWarnings("boxing") // OK here
     @Parameters
     public static Collection<Object[]> getParameters() {
-        final ArrayList<Object[]> parameters = new ArrayList<Object[]>();
+        final ArrayList<Object[]> parameters = new ArrayList<>();
         for (int k = 1; k <= MAX_NUM_POINTS; k++) {
             parameters.add(new Object[] { k, 2 * k - 1, Math.ulp(1d), 91d });
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolatorTest.java
index 1e5b031..33fab5d 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolatorTest.java
@@ -33,7 +33,7 @@ public class FieldHermiteInterpolatorTest {
 
     @Test
     public void testZero() {
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(0), new BigFraction[] { new BigFraction(0) });
         for (int x = -10; x < 10; x++) {
             BigFraction y = interpolator.value(new BigFraction(x))[0];
@@ -46,7 +46,7 @@ public class FieldHermiteInterpolatorTest {
 
     @Test
     public void testQuadratic() {
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(0), new BigFraction[] { new BigFraction(2) });
         interpolator.addSamplePoint(new BigFraction(1), new BigFraction[] { new BigFraction(0) });
         interpolator.addSamplePoint(new BigFraction(2), new BigFraction[] { new BigFraction(0) });
@@ -63,7 +63,7 @@ public class FieldHermiteInterpolatorTest {
 
     @Test
     public void testMixedDerivatives() {
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(0), new BigFraction[] { new BigFraction(1) }, new BigFraction[] { new BigFraction(2) });
         interpolator.addSamplePoint(new BigFraction(1), new BigFraction[] { new BigFraction(4) });
         interpolator.addSamplePoint(new BigFraction(2), new BigFraction[] { new BigFraction(5) }, new BigFraction[] { new BigFraction(2) });
@@ -107,7 +107,7 @@ public class FieldHermiteInterpolatorTest {
 
             DfpField field = new DfpField(30);
             Dfp step = field.getOne().divide(field.newDfp(10));
-            FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<Dfp>();
+            FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<>();
             for (int j = 0; j < 1 + maxDegree; ++j) {
                 Dfp x = field.newDfp(j).multiply(step);
                 Dfp[] values = new Dfp[p.length];
@@ -151,7 +151,7 @@ public class FieldHermiteInterpolatorTest {
 
             DfpField field = new DfpField(30);
             Dfp step = field.getOne().divide(field.newDfp(10));
-            FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<Dfp>();
+            FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<>();
             for (int j = 0; j < 1 + maxDegree / 2; ++j) {
                 Dfp x = field.newDfp(j).multiply(step);
                 Dfp[] values      = new Dfp[p.length];
@@ -186,7 +186,7 @@ public class FieldHermiteInterpolatorTest {
     @Test
     public void testSine() {
         DfpField field = new DfpField(30);
-        FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<Dfp>();
+        FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<>();
         for (Dfp x = field.getZero(); x.getReal() < FastMath.PI; x = x.add(0.5)) {
             interpolator.addSamplePoint(x, new Dfp[] { x.sin() });
         }
@@ -199,7 +199,7 @@ public class FieldHermiteInterpolatorTest {
     @Test
     public void testSquareRoot() {
         DfpField field = new DfpField(30);
-        FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<Dfp>();
+        FieldHermiteInterpolator<Dfp> interpolator = new FieldHermiteInterpolator<>();
         for (Dfp x = field.getOne(); x.getReal() < 3.6; x = x.add(0.5)) {
             interpolator.addSamplePoint(x, new Dfp[] { x.sqrt() });
         }
@@ -213,7 +213,7 @@ public class FieldHermiteInterpolatorTest {
     public void testWikipedia() {
         // this test corresponds to the example from Wikipedia page:
         // http://en.wikipedia.org/wiki/Hermite_interpolation
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(-1),
                                     new BigFraction[] { new BigFraction( 2) },
                                     new BigFraction[] { new BigFraction(-8) },
@@ -237,7 +237,7 @@ public class FieldHermiteInterpolatorTest {
 
     @Test
     public void testOnePointParabola() {
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(0),
                                     new BigFraction[] { new BigFraction(1) },
                                     new BigFraction[] { new BigFraction(1) },
@@ -268,7 +268,7 @@ public class FieldHermiteInterpolatorTest {
 
     @Test(expected=MathIllegalArgumentException.class)
     public void testDuplicatedAbscissa() {
-        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<BigFraction>();
+        FieldHermiteInterpolator<BigFraction> interpolator = new FieldHermiteInterpolator<>();
         interpolator.addSamplePoint(new BigFraction(1), new BigFraction[] { new BigFraction(0) });
         interpolator.addSamplePoint(new BigFraction(1), new BigFraction[] { new BigFraction(1) });
     }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java b/src/test/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
index a1d5587..d50e06c 100644
--- a/src/test/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
@@ -36,14 +36,14 @@ public final class FieldBracketingNthOrderBrentSolverTest {
 
     @Test(expected=NumberIsTooSmallException.class)
     public void testInsufficientOrder3() {
-        new FieldBracketingNthOrderBrentSolver<Dfp>(relativeAccuracy, absoluteAccuracy,
+        new FieldBracketingNthOrderBrentSolver<>(relativeAccuracy, absoluteAccuracy,
                                                     functionValueAccuracy, 1);
     }
 
     @Test
     public void testConstructorOK() {
         FieldBracketingNthOrderBrentSolver<Dfp> solver =
-                new FieldBracketingNthOrderBrentSolver<Dfp>(relativeAccuracy, absoluteAccuracy,
+                new FieldBracketingNthOrderBrentSolver<>(relativeAccuracy, absoluteAccuracy,
                                                             functionValueAccuracy, 2);
         Assert.assertEquals(2, solver.getMaximalOrder());
     }
@@ -51,7 +51,7 @@ public final class FieldBracketingNthOrderBrentSolverTest {
     @Test
     public void testConvergenceOnFunctionAccuracy() {
         FieldBracketingNthOrderBrentSolver<Dfp> solver =
-                new FieldBracketingNthOrderBrentSolver<Dfp>(relativeAccuracy, absoluteAccuracy,
+                new FieldBracketingNthOrderBrentSolver<>(relativeAccuracy, absoluteAccuracy,
                                                             field.newDfp(1.0e-20), 20);
         RealFieldUnivariateFunction<Dfp> f = new RealFieldUnivariateFunction<Dfp>() {
             public Dfp value(Dfp x) {
@@ -127,7 +127,7 @@ public final class FieldBracketingNthOrderBrentSolverTest {
     private void check(RealFieldUnivariateFunction<Dfp> f, int maxEval, double min, double max,
                        AllowedSolution allowedSolution) {
         FieldBracketingNthOrderBrentSolver<Dfp> solver =
-                new FieldBracketingNthOrderBrentSolver<Dfp>(relativeAccuracy, absoluteAccuracy,
+                new FieldBracketingNthOrderBrentSolver<>(relativeAccuracy, absoluteAccuracy,
                                                      functionValueAccuracy, 20);
         Dfp xResult = solver.solve(maxEval, f, field.newDfp(min), field.newDfp(max),
                                    allowedSolution);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
index f1cf652..f903cbc 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
@@ -192,10 +192,10 @@ public class EnumeratedRealDistributionTest {
 
     @Test
     public void testIssue942() {
-        List<Pair<Object,Double>> list = new ArrayList<Pair<Object, Double>>();
+        List<Pair<Object,Double>> list = new ArrayList<>();
         list.add(new Pair<Object, Double>(new Object() {}, new Double(0)));
         list.add(new Pair<Object, Double>(new Object() {}, new Double(1)));
-        Assert.assertEquals(1, new EnumeratedDistribution<Object>(list).sample(1).length);
+        Assert.assertEquals(1, new EnumeratedDistribution<>(list).sample(1).length);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalMixtureModelDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalMixtureModelDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalMixtureModelDistributionTest.java
index 8bed770..aedaba0 100644
--- a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalMixtureModelDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalMixtureModelDistributionTest.java
@@ -151,12 +151,12 @@ public class MultivariateNormalMixtureModelDistributionTest {
                                                               double[][] means,
                                                               double[][][] covariances) {
         final List<Pair<Double, MultivariateNormalDistribution>> mvns
-            = new ArrayList<Pair<Double, MultivariateNormalDistribution>>();
+            = new ArrayList<>();
 
         for (int i = 0; i < weights.length; i++) {
             final MultivariateNormalDistribution dist
                 = new MultivariateNormalDistribution(means[i], covariances[i]);
-            mvns.add(new Pair<Double, MultivariateNormalDistribution>(weights[i], dist));
+            mvns.add(new Pair<>(weights[i], dist));
         }
 
         return new MultivariateNormalMixtureModelDistribution(mvns);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
index 9fffeaf..1a5e210 100644
--- a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
@@ -357,7 +357,7 @@ public abstract class RealDistributionAbstractTest {
                 return distribution.density(x);
             }
         };
-        final ArrayList<Double> integrationTestPoints = new ArrayList<Double>();
+        final ArrayList<Double> integrationTestPoints = new ArrayList<>();
         for (int i = 0; i < cumulativeTestPoints.length; i++) {
             if (Double.isNaN(cumulativeTestValues[i]) ||
                     cumulativeTestValues[i] < 1.0e-5 ||

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java b/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
index cb68603..f31f4c8 100644
--- a/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
@@ -129,10 +129,10 @@ public class MultivariateNormalMixtureExpectationMaximizationTest {
 
         // Create components and mixture
         List<Pair<Double, MultivariateNormalDistribution>> components =
-                new ArrayList<Pair<Double, MultivariateNormalDistribution>>();
-        components.add(new Pair<Double, MultivariateNormalDistribution>(
+                new ArrayList<>();
+        components.add(new Pair<>(
                 weights[0], mvns[0]));
-        components.add(new Pair<Double, MultivariateNormalDistribution>(
+        components.add(new Pair<>(
                 weights[1], mvns[1]));
 
         MixtureMultivariateNormalDistribution badInitialMix

http://git-wip-us.apache.org/repos/asf/commons-math/blob/8b5f4535/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java b/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
index 46ed189..e7fddf6 100644
--- a/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
 public class ArgUtilsTest {
     @Test
     public void testFlatten() {
-        final List<Object> orig = new ArrayList<Object>();
+        final List<Object> orig = new ArrayList<>();
 
         final Object[] struct = new Object[] {
             new Object[] {


Mime
View raw message