Remove redundant type arguments.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/762eb53f
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/762eb53f
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/762eb53f

Branch: refs/heads/master
Commit: 762eb53f5cee901be190cd324dfde01977aeea60
Parents: 98e27f5
Author: Gary Gregory <ggreg...@apache.org>
Authored: Tue Sep 20 10:37:01 2016 -0700
Committer: Gary Gregory <ggreg...@apache.org>
Committed: Tue Sep 20 10:37:01 2016 -0700

----------------------------------------------------------------------
 .../analysis/differentiation/DSCompiler.java    |  10 +-
 .../differentiation/SparseGradient.java         |   4 +-
 .../integration/gauss/BaseRuleFactory.java      |   8 +-
 .../gauss/GaussIntegratorFactory.java           |   2 +-
 .../integration/gauss/HermiteRuleFactory.java   |   4 +-
 .../integration/gauss/LaguerreRuleFactory.java  |   2 +-
 .../gauss/LegendreHighPrecisionRuleFactory.java |   4 +-
 .../integration/gauss/LegendreRuleFactory.java  |   4 +-
 .../interpolation/FieldHermiteInterpolator.java |   6 +-
 .../interpolation/HermiteInterpolator.java      |   6 +-
 .../interpolation/InterpolatingMicrosphere.java |   6 +-
 .../analysis/polynomials/PolynomialsUtils.java  |  12 +-
 .../apache/commons/math4/complex/Complex.java   |   2 +-
 .../distribution/EmpiricalDistribution.java     |   2 +-
 .../distribution/EnumeratedDistribution.java    |   6 +-
 .../EnumeratedIntegerDistribution.java          |  10 +-
 .../EnumeratedRealDistribution.java             |  10 +-
 .../MixtureMultivariateNormalDistribution.java  |   4 +-
 .../MixtureMultivariateRealDistribution.java    |   6 +-
 ...ateNormalMixtureExpectationMaximization.java |   4 +-
 .../commons/math4/exception/util/ArgUtils.java  |   2 +-
 .../math4/exception/util/ExceptionContext.java  |  12 +-
 .../math4/fitting/GaussianCurveFitter.java      |   2 +-
 .../math4/fitting/HarmonicCurveFitter.java      |   2 +-
 .../math4/fitting/WeightedObservedPoints.java   |   4 +-
 .../leastsquares/GaussNewtonOptimizer.java      |   2 +-
 .../leastsquares/LeastSquaresFactory.java       |   2 +-
 .../math4/genetics/AbstractListChromosome.java  |   2 +-
 .../math4/genetics/BinaryChromosome.java        |   2 +-
 .../commons/math4/genetics/BinaryMutation.java  |   2 +-
 .../commons/math4/genetics/CycleCrossover.java  |   8 +-
 .../commons/math4/genetics/ListPopulation.java  |   2 +-
 .../commons/math4/genetics/NPointCrossover.java |   4 +-
 .../math4/genetics/OnePointCrossover.java       |   4 +-
 .../math4/genetics/OrderedCrossover.java        |   8 +-
 .../commons/math4/genetics/RandomKey.java       |  16 +-
 .../math4/genetics/RandomKeyMutation.java       |   2 +-
 .../math4/genetics/TournamentSelection.java     |   2 +-
 .../math4/genetics/UniformCrossover.java        |   4 +-
 .../math4/geometry/enclosing/WelzlEncloser.java |   4 +-
 .../geometry/euclidean/oned/IntervalsSet.java   |  22 +-
 .../euclidean/oned/SubOrientedPoint.java        |   6 +-
 .../euclidean/threed/FieldRotation.java         |  40 ++--
 .../euclidean/threed/FieldVector3D.java         |  42 ++--
 .../euclidean/threed/OutlineExtractor.java      |   2 +-
 .../euclidean/threed/PolyhedronsSet.java        |   4 +-
 .../euclidean/threed/SphereGenerator.java       |  10 +-
 .../geometry/euclidean/threed/SubLine.java      |   2 +-
 .../geometry/euclidean/threed/SubPlane.java     |  12 +-
 .../geometry/euclidean/twod/DiskGenerator.java  |   8 +-
 .../geometry/euclidean/twod/NestedLoops.java    |   8 +-
 .../geometry/euclidean/twod/PolygonsSet.java    |  18 +-
 .../math4/geometry/euclidean/twod/SubLine.java  |  14 +-
 .../twod/hull/AklToussaintHeuristic.java        |   4 +-
 .../euclidean/twod/hull/ConvexHull2D.java       |   2 +-
 .../euclidean/twod/hull/MonotoneChain.java      |   8 +-
 .../geometry/partitioning/AbstractRegion.java   |  26 +--
 .../partitioning/AbstractSubHyperplane.java     |   8 +-
 .../math4/geometry/partitioning/BSPTree.java    |  34 +--
 .../geometry/partitioning/BoundaryBuilder.java  |  12 +-
 .../partitioning/BoundaryProjector.java         |   4 +-
 .../geometry/partitioning/Characterization.java |   4 +-
 .../math4/geometry/partitioning/NodesSet.java   |   2 +-
 .../geometry/partitioning/RegionFactory.java    |  14 +-
 .../math4/geometry/spherical/oned/ArcsSet.java  |  36 +--
 .../geometry/spherical/oned/SubLimitAngle.java  |   4 +-
 .../geometry/spherical/twod/EdgesBuilder.java   |   6 +-
 .../spherical/twod/PropertiesComputer.java      |   2 +-
 .../spherical/twod/SphericalPolygonsSet.java    |  30 +--
 .../geometry/spherical/twod/SubCircle.java      |   4 +-
 .../math4/geometry/spherical/twod/Vertex.java   |   2 +-
 .../math4/linear/AbstractFieldMatrix.java       |  16 +-
 .../math4/linear/AbstractRealMatrix.java        |   2 +-
 .../math4/linear/Array2DRowFieldMatrix.java     |  10 +-
 .../commons/math4/linear/ArrayFieldVector.java  |  40 ++--
 .../commons/math4/linear/BlockFieldMatrix.java  |  32 +--
 .../math4/linear/FieldLUDecomposition.java      |  16 +-
 .../commons/math4/linear/MatrixUtils.java       |   8 +-
 .../commons/math4/linear/RealMatrixFormat.java  |   6 +-
 .../commons/math4/linear/RealVectorFormat.java  |   2 +-
 .../commons/math4/linear/SparseFieldMatrix.java |  12 +-
 .../commons/math4/linear/SparseFieldVector.java |  32 +--
 .../commons/math4/ml/clustering/Cluster.java    |   2 +-
 .../math4/ml/clustering/DBSCANClusterer.java    |  12 +-
 .../ml/clustering/FuzzyKMeansClusterer.java     |   6 +-
 .../ml/clustering/KMeansPlusPlusClusterer.java  |   6 +-
 .../commons/math4/ml/neuralnet/MapUtils.java    |   6 +-
 .../commons/math4/ml/neuralnet/Network.java     |  14 +-
 .../commons/math4/ml/neuralnet/Neuron.java      |   2 +-
 .../ml/neuralnet/sofm/KohonenUpdateAction.java  |   4 +-
 .../ml/neuralnet/twod/NeuronSquareMesh2D.java   |   2 +-
 .../ml/neuralnet/twod/util/LocationFinder.java  |   2 +-
 .../math4/ode/AbstractFieldIntegrator.java      |  14 +-
 .../commons/math4/ode/AbstractIntegrator.java   |   8 +-
 .../math4/ode/AbstractParameterizable.java      |   4 +-
 .../math4/ode/ContinuousOutputFieldModel.java   |   2 +-
 .../math4/ode/ContinuousOutputModel.java        |   2 +-
 .../math4/ode/ExpandableStatefulODE.java        |   4 +-
 .../commons/math4/ode/FieldEquationsMapper.java |   4 +-
 .../commons/math4/ode/FieldExpandableODE.java   |   6 +-
 .../commons/math4/ode/JacobianMatrices.java     |   2 +-
 .../math4/ode/MultistepFieldIntegrator.java     |   4 +-
 .../math4/ode/ParameterJacobianWrapper.java     |   2 +-
 .../commons/math4/ode/ParameterizedWrapper.java |   2 +-
 .../nonstiff/AdamsBashforthFieldIntegrator.java |   2 +-
 .../nonstiff/AdamsFieldStepInterpolator.java    |   6 +-
 .../nonstiff/AdamsMoultonFieldIntegrator.java   |   4 +-
 .../AdamsNordsieckFieldTransformer.java         |  22 +-
 .../ode/nonstiff/AdamsNordsieckTransformer.java |  10 +-
 .../ClassicalRungeKuttaFieldIntegrator.java     |   2 +-
 ...lassicalRungeKuttaFieldStepInterpolator.java |   4 +-
 .../DormandPrince54FieldIntegrator.java         |   2 +-
 .../DormandPrince54FieldStepInterpolator.java   |   4 +-
 .../DormandPrince853FieldIntegrator.java        |   2 +-
 .../DormandPrince853FieldStepInterpolator.java  |   4 +-
 .../EmbeddedRungeKuttaFieldIntegrator.java      |   2 +-
 .../ode/nonstiff/EulerFieldIntegrator.java      |   2 +-
 .../nonstiff/EulerFieldStepInterpolator.java    |   4 +-
 .../math4/ode/nonstiff/GillFieldIntegrator.java |   2 +-
 .../ode/nonstiff/GillFieldStepInterpolator.java |   4 +-
 .../nonstiff/HighamHall54FieldIntegrator.java   |   2 +-
 .../HighamHall54FieldStepInterpolator.java      |   4 +-
 .../ode/nonstiff/LutherFieldIntegrator.java     |   2 +-
 .../nonstiff/LutherFieldStepInterpolator.java   |   4 +-
 .../ode/nonstiff/MidpointFieldIntegrator.java   |   2 +-
 .../nonstiff/MidpointFieldStepInterpolator.java |   4 +-
 .../ode/nonstiff/RungeKuttaFieldIntegrator.java |   2 +-
 .../nonstiff/ThreeEighthesFieldIntegrator.java  |   2 +-
 .../ThreeEighthesFieldStepInterpolator.java     |   4 +-
 .../math4/optim/linear/LinearConstraintSet.java |   2 +-
 .../math4/optim/linear/SimplexSolver.java       |   2 +-
 .../math4/optim/linear/SimplexTableau.java      |   8 +-
 .../scalar/MultiStartMultivariateOptimizer.java |   2 +-
 .../scalar/noderiv/CMAESOptimizer.java          |   8 +-
 .../commons/math4/primes/SmallPrimes.java       |   2 +-
 .../commons/math4/random/RandomUtils.java       |   4 +-
 .../apache/commons/math4/stat/Frequency.java    |   6 +-
 .../stat/correlation/KendallsCorrelation.java   |   2 +-
 .../descriptive/rank/PSquarePercentile.java     |   2 +-
 .../stat/inference/KolmogorovSmirnovTest.java   |   4 +-
 .../math4/stat/inference/OneWayAnova.java       |   2 +-
 .../math4/stat/ranking/NaturalRanking.java      |   6 +-
 .../commons/math4/util/CombinatoricsUtils.java  |   2 +-
 .../commons/math4/util/IterationManager.java    |   4 +-
 .../apache/commons/math4/util/MathArrays.java   |   4 +-
 .../org/apache/commons/math4/util/Pair.java     |   2 +-
 .../commons/math4/util/TransformerMap.java      |   2 +-
 .../differentiation/DSCompilerTest.java         |   4 +-
 .../integration/gauss/BaseRuleFactoryTest.java  |   4 +-
 .../integration/gauss/GaussIntegratorTest.java  |   6 +-
 .../gauss/HermiteParametricTest.java            |   2 +-
 .../LegendreHighPrecisionParametricTest.java    |   2 +-
 .../gauss/LegendreParametricTest.java           |   2 +-
 .../FieldHermiteInterpolatorTest.java           |  20 +-
 .../FieldBracketingNthOrderBrentSolverTest.java |   8 +-
 .../distribution/EmpiricalDistributionTest.java |   2 +-
 .../EnumeratedRealDistributionTest.java         |   4 +-
 .../RealDistributionAbstractTest.java           |   2 +-
 ...ormalMixtureExpectationMaximizationTest.java |   6 +-
 .../math4/exception/util/ArgUtilsTest.java      |   2 +-
 .../math4/fitting/HarmonicCurveFitterTest.java  |   2 +-
 .../fitting/leastsquares/CircleProblem.java     |   2 +-
 .../fitting/leastsquares/CircleVectorial.java   |   2 +-
 .../fitting/leastsquares/EvaluationTest.java    |   4 +-
 .../leastsquares/EvaluationTestValidation.java  |   2 +-
 .../LevenbergMarquardtOptimizerTest.java        |   4 +-
 .../StatisticalReferenceDataset.java            |   2 +-
 .../leastsquares/StraightLineProblem.java       |   2 +-
 .../commons/math4/genetics/ChromosomeTest.java  |   2 +-
 .../math4/genetics/FitnessCachingTest.java      |   2 +-
 .../genetics/GeneticAlgorithmTestBinary.java    |   2 +-
 .../GeneticAlgorithmTestPermutations.java       |   4 +-
 .../math4/genetics/ListPopulationTest.java      |  14 +-
 .../math4/genetics/NPointCrossoverTest.java     |   2 +-
 .../math4/genetics/OnePointCrossoverTest.java   |   2 +-
 .../math4/genetics/OrderedCrossoverTest.java    |   4 +-
 .../math4/genetics/UniformCrossoverTest.java    |   4 +-
 .../geometry/enclosing/WelzlEncloser2DTest.java |  12 +-
 .../geometry/enclosing/WelzlEncloser3DTest.java |  14 +-
 .../euclidean/oned/IntervalsSetTest.java        |   2 +-
 .../euclidean/threed/FieldRotationDSTest.java   | 118 +++++-----
 .../euclidean/threed/FieldRotationDfpTest.java  | 116 +++++-----
 .../euclidean/threed/FieldVector3DTest.java     |  48 ++--
 .../geometry/euclidean/threed/PLYParser.java    |   2 +-
 .../euclidean/threed/PolyhedronsSetTest.java    |   6 +-
 .../euclidean/threed/SphereGeneratorTest.java   |   2 +-
 .../euclidean/twod/DiskGeneratorTest.java       |   2 +-
 .../euclidean/twod/PolygonsSetTest.java         |  52 ++---
 .../hull/ConvexHullGenerator2DAbstractTest.java |  24 +-
 .../euclidean/twod/hull/MonotoneChainTest.java  |   2 +-
 .../geometry/partitioning/RegionParser.java     |   2 +-
 .../geometry/spherical/oned/ArcsSetTest.java    |  14 +-
 .../twod/SphericalPolygonsSetTest.java          |  14 +-
 .../geometry/spherical/twod/SubCircleTest.java  |   2 +-
 .../math4/linear/ArrayFieldVectorTest.java      |  96 ++++----
 .../math4/linear/BlockFieldMatrixTest.java      | 226 +++++++++----------
 .../math4/linear/FieldLUDecompositionTest.java  |  62 ++---
 .../commons/math4/linear/FieldLUSolverTest.java |  18 +-
 .../math4/linear/FieldMatrixImplTest.java       | 212 ++++++++---------
 .../commons/math4/linear/MatrixUtilsTest.java   |  16 +-
 .../math4/linear/SparseFieldMatrixTest.java     |  26 +--
 .../math4/linear/SparseFieldVectorTest.java     |  40 ++--
 .../UnmodifiableRealVectorAbstractTest.java     |   2 +-
 .../ml/clustering/DBSCANClustererTest.java      |  10 +-
 .../ml/clustering/FuzzyKMeansClustererTest.java |  16 +-
 .../clustering/KMeansPlusPlusClustererTest.java |  10 +-
 .../MultiKMeansPlusPlusClustererTest.java       |   2 +-
 .../evaluation/SumOfClusterVariancesTest.java   |   8 +-
 .../math4/ml/neuralnet/MapUtilsTest.java        |   6 +-
 .../ml/neuralnet/oned/NeuronStringTest.java     |   2 +-
 .../neuralnet/sofm/KohonenTrainingTaskTest.java |   4 +-
 .../sofm/TravellingSalesmanSolver.java          |   8 +-
 .../neuralnet/twod/NeuronSquareMesh2DTest.java  |   8 +-
 .../ode/ContinuousOutputFieldModelTest.java     |  44 ++--
 .../math4/ode/FieldExpandableODETest.java       |  46 ++--
 .../commons/math4/ode/TestFieldProblem4.java    |   6 +-
 .../math4/ode/TestFieldProblemAbstract.java     |   2 +-
 .../math4/ode/events/OverlappingEventsTest.java |   4 +-
 ...ctEmbeddedRungeKuttaFieldIntegratorTest.java |  64 +++---
 .../AbstractRungeKuttaFieldIntegratorTest.java  |  80 +++----
 .../AdamsBashforthFieldIntegratorTest.java      |   4 +-
 .../AdamsFieldIntegratorAbstractTest.java       |  44 ++--
 .../AdamsMoultonFieldIntegratorTest.java        |   4 +-
 ...sicalRungKuttaFieldStepInterpolatorTest.java |   4 +-
 .../ClassicalRungeKuttaFieldIntegratorTest.java |   2 +-
 .../DormandPrince54FieldIntegratorTest.java     |   4 +-
 ...ormandPrince54FieldStepInterpolatorTest.java |   4 +-
 .../DormandPrince853FieldIntegratorTest.java    |   4 +-
 ...rmandPrince853FieldStepInterpolatorTest.java |   4 +-
 ...edRungeKuttaFieldIntegratorAbstractTest.java |  64 +++---
 .../ode/nonstiff/EulerFieldIntegratorTest.java  |   2 +-
 .../EulerFieldStepInterpolatorTest.java         |   4 +-
 .../ode/nonstiff/GillFieldIntegratorTest.java   |   2 +-
 .../nonstiff/GillFieldStepInterpolatorTest.java |   4 +-
 .../HighamHall54FieldIntegratorTest.java        |   4 +-
 .../HighamHall54FieldStepInterpolatorTest.java  |   4 +-
 .../ode/nonstiff/LutherFieldIntegratorTest.java |   2 +-
 .../LutherFieldStepInterpolatorTest.java        |   4 +-
 .../nonstiff/MidpointFieldIntegratorTest.java   |   2 +-
 .../MidpointFieldStepInterpolatorTest.java      |   4 +-
 .../RungeKuttaFieldIntegratorAbstractTest.java  |  80 +++----
 ...eKuttaFieldStepInterpolatorAbstractTest.java |  12 +-
 .../ThreeEighthesFieldIntegratorTest.java       |   2 +-
 .../ThreeEighthesFieldStepInterpolatorTest.java |   4 +-
 .../sampling/DummyFieldStepInterpolator.java    |   2 +-
 .../ode/sampling/StepInterpolatorTestUtils.java |   2 +-
 .../sampling/StepNormalizerOutputTestBase.java  |   2 +-
 .../math4/optim/SimplePointCheckerTest.java     |   4 +-
 .../math4/optim/linear/SimplexSolverTest.java   |  62 ++---
 .../math4/optim/linear/SimplexTableauTest.java  |   4 +-
 .../nonlinear/scalar/gradient/CircleScalar.java |   2 +-
 .../apache/commons/math4/primes/PrimesTest.java |   2 +-
 .../RandomUtilsDataGeneratorAbstractTest.java   |  10 +-
 .../random/SynchronizedRandomGeneratorTest.java |   2 +-
 .../commons/math4/stat/FrequencyTest.java       |   2 +-
 .../stat/data/CertifiedDataAbstractTest.java    |   2 +-
 .../AggregateSummaryStatisticsTest.java         |   8 +-
 .../stat/descriptive/ListUnivariateImpl.java    |   2 +-
 .../descriptive/ListUnivariateImplTest.java     |   6 +-
 .../MixedListUnivariateImplTest.java            |   8 +-
 .../UnivariateStatisticAbstractTest.java        |   2 +-
 .../descriptive/rank/PSquarePercentileTest.java |   4 +-
 .../stat/inference/InferenceTestUtilsTest.java  |   2 +-
 .../math4/stat/inference/OneWayAnovaTest.java   |  20 +-
 .../math4/util/CombinatoricsUtilsTest.java      |   2 +-
 .../util/FastMathStrictComparisonTest.java      |   2 +-
 .../commons/math4/util/IntegerSequenceTest.java |  16 +-
 .../math4/util/OpenIntToDoubleHashMapTest.java  |   8 +-
 .../commons/math4/util/OpenIntToFieldTest.java  |  26 +--
 .../org/apache/commons/math4/util/PairTest.java |  24 +-
 270 files changed, 1551 insertions(+), 1553 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/differentiation/DSCompiler.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/differentiation/DSCompiler.java
 
b/src/main/java/org/apache/commons/math4/analysis/differentiation/DSCompiler.java
index 8e07838..3c1838d 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/differentiation/DSCompiler.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/differentiation/DSCompiler.java
@@ -126,7 +126,7 @@ public class DSCompiler {
 
     /** Array of all compilers created so far. */
     private static AtomicReference<DSCompiler[][]> compilers =
-            new AtomicReference<DSCompiler[][]>(null);
+            new AtomicReference<>(null);
 
     /** Number of free parameters. */
     private final int parameters;
@@ -358,14 +358,14 @@ public class DSCompiler {
 
         for (int i = 0; i < dSize; ++i) {
             final int[][] dRow = derivativeCompiler.multIndirection[i];
-            List<int[]> row = new ArrayList<int[]>(dRow.length * 2);
+            List<int[]> row = new ArrayList<>(dRow.length * 2);
             for (int j = 0; j < dRow.length; ++j) {
                 row.add(new int[] { dRow[j][0], lowerIndirection[dRow[j][1]], 
vSize + dRow[j][2] });
                 row.add(new int[] { dRow[j][0], vSize + dRow[j][1], 
lowerIndirection[dRow[j][2]] });
             }
 
             // combine terms with similar derivation orders
-            final List<int[]> combined = new ArrayList<int[]>(row.size());
+            final List<int[]> combined = new ArrayList<>(row.size());
             for (int j = 0; j < row.size(); ++j) {
                 final int[] termJ = row.get(j);
                 if (termJ[0] > 0) {
@@ -428,7 +428,7 @@ public class DSCompiler {
         // with respect to the parameter this compiler handles and the
         // underlying one did not handle
         for (int i = 0; i < dSize; ++i) {
-            List<int[]> row = new ArrayList<int[]>();
+            List<int[]> row = new ArrayList<>();
             for (int[] term : derivativeCompiler.compIndirection[i]) {
 
                 // handle term p * f_k(g(x)) * g_l1(x) * g_l2(x) * ... * 
g_lp(x)
@@ -475,7 +475,7 @@ public class DSCompiler {
             }
 
             // combine terms with similar derivation orders
-            final List<int[]> combined = new ArrayList<int[]>(row.size());
+            final List<int[]> combined = new ArrayList<>(row.size());
             for (int j = 0; j < row.size(); ++j) {
                 final int[] termJ = row.get(j);
                 if (termJ[0] > 0) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/differentiation/SparseGradient.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/differentiation/SparseGradient.java
 
b/src/main/java/org/apache/commons/math4/analysis/differentiation/SparseGradient.java
index 130c335..643a975 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/differentiation/SparseGradient.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/differentiation/SparseGradient.java
@@ -61,7 +61,7 @@ public class SparseGradient implements 
RealFieldElement<SparseGradient>, Seriali
      */
     private SparseGradient(final double value, final Map<Integer, Double> 
derivatives) {
         this.value = value;
-        this.derivatives = new HashMap<Integer, Double>();
+        this.derivatives = new HashMap<>();
         if (derivatives != null) {
             this.derivatives.putAll(derivatives);
         }
@@ -77,7 +77,7 @@ public class SparseGradient implements 
RealFieldElement<SparseGradient>, Seriali
     private SparseGradient(final double value, final double scale,
                              final Map<Integer, Double> derivatives) {
         this.value = value;
-        this.derivatives = new HashMap<Integer, Double>();
+        this.derivatives = new HashMap<>();
         if (derivatives != null) {
             for (final Map.Entry<Integer, Double> entry : 
derivatives.entrySet()) {
                 this.derivatives.put(entry.getKey(), scale * entry.getValue());

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactory.java
index 0b36238..bd05c5e 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/BaseRuleFactory.java
@@ -37,10 +37,10 @@ import org.apache.commons.math4.util.Pair;
 public abstract class BaseRuleFactory<T extends Number> {
     /** List of points and weights, indexed by the order of the rule. */
     private final Map<Integer, Pair<T[], T[]>> pointsAndWeights
-        = new TreeMap<Integer, Pair<T[], T[]>>();
+        = new TreeMap<>();
     /** Cache for double-precision rules. */
     private final Map<Integer, Pair<double[], double[]>> pointsAndWeightsDouble
-        = new TreeMap<Integer, Pair<double[], double[]>>();
+        = new TreeMap<>();
 
     /**
      * Gets a copy of the quadrature rule with the given number of integration
@@ -75,7 +75,7 @@ public abstract class BaseRuleFactory<T extends Number> {
         }
 
         // Return a copy.
-        return new Pair<double[], double[]>(cached.getFirst().clone(),
+        return new Pair<>(cached.getFirst().clone(),
                                             cached.getSecond().clone());
     }
 
@@ -149,6 +149,6 @@ public abstract class BaseRuleFactory<T extends Number> {
             wD[i] = wT[i].doubleValue();
         }
 
-        return new Pair<double[], double[]>(pD, wD);
+        return new Pair<>(pD, wD);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java
index 4dacc67..2504692 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java
@@ -183,6 +183,6 @@ public class GaussIntegratorFactory {
             weights[i] *= scale;
         }
 
-        return new Pair<double[], double[]>(points, weights);
+        return new Pair<>(points, weights);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java
index 5c1d0a2..e65f5bd 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java
@@ -63,7 +63,7 @@ public class HermiteRuleFactory extends 
BaseRuleFactory<Double> {
 
         if (numberOfPoints == 1) {
             // Break recursion.
-            return new Pair<Double[], Double[]>(new Double[] { 0d },
+            return new Pair<>(new Double[] { 0d },
                                                 new Double[] { SQRT_PI });
         }
 
@@ -172,6 +172,6 @@ public class HermiteRuleFactory extends 
BaseRuleFactory<Double> {
             weights[iMax] = w;
         }
 
-        return new Pair<Double[], Double[]>(points, weights);
+        return new Pair<>(points, weights);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java
index 220c460..25031e8 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java
@@ -57,7 +57,7 @@ public class LaguerreRuleFactory extends 
BaseRuleFactory<Double> {
             weights[i] = xi / n1Squared / (val * val);
         }
 
-        return new Pair<Double[], Double[]>(points, weights);
+        return new Pair<>(points, weights);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
index e4108a2..1790c72 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java
@@ -66,7 +66,7 @@ public class LegendreHighPrecisionRuleFactory extends 
BaseRuleFactory<BigDecimal
 
         if (numberOfPoints == 1) {
             // Break recursion.
-            return new Pair<BigDecimal[], BigDecimal[]>(new BigDecimal[] { 
BigDecimal.ZERO },
+            return new Pair<>(new BigDecimal[] { BigDecimal.ZERO },
                                                         new BigDecimal[] { two 
});
         }
 
@@ -210,6 +210,6 @@ public class LegendreHighPrecisionRuleFactory extends 
BaseRuleFactory<BigDecimal
             weights[iMax] = tmp2;
         }
 
-        return new Pair<BigDecimal[], BigDecimal[]>(points, weights);
+        return new Pair<>(points, weights);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java
 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java
index 113ab38..29684bf 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java
@@ -37,7 +37,7 @@ public class LegendreRuleFactory extends 
BaseRuleFactory<Double> {
 
         if (numberOfPoints == 1) {
             // Break recursion.
-            return new Pair<Double[], Double[]>(new Double[] { 0d },
+            return new Pair<>(new Double[] { 0d },
                                                 new Double[] { 2d });
         }
 
@@ -135,6 +135,6 @@ public class LegendreRuleFactory extends 
BaseRuleFactory<Double> {
             weights[iMax] = w;
         }
 
-        return new Pair<Double[], Double[]>(points, weights);
+        return new Pair<>(points, weights);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
index e5e660f..3241ddf 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
@@ -61,9 +61,9 @@ public class FieldHermiteInterpolator<T extends 
FieldElement<T>> {
     /** Create an empty interpolator.
      */
     public FieldHermiteInterpolator() {
-        this.abscissae      = new ArrayList<T>();
-        this.topDiagonal    = new ArrayList<T[]>();
-        this.bottomDiagonal = new ArrayList<T[]>();
+        this.abscissae      = new ArrayList<>();
+        this.topDiagonal    = new ArrayList<>();
+        this.bottomDiagonal = new ArrayList<>();
     }
 
     /** Add a sample point.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/interpolation/HermiteInterpolator.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/HermiteInterpolator.java
 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/HermiteInterpolator.java
index 3aeb135..5a30815 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/HermiteInterpolator.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/HermiteInterpolator.java
@@ -59,9 +59,9 @@ public class HermiteInterpolator implements 
UnivariateDifferentiableVectorFuncti
     /** Create an empty interpolator.
      */
     public HermiteInterpolator() {
-        this.abscissae      = new ArrayList<Double>();
-        this.topDiagonal    = new ArrayList<double[]>();
-        this.bottomDiagonal = new ArrayList<double[]>();
+        this.abscissae      = new ArrayList<>();
+        this.topDiagonal    = new ArrayList<>();
+        this.bottomDiagonal = new ArrayList<>();
     }
 
     /** Add a sample point.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/interpolation/InterpolatingMicrosphere.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/InterpolatingMicrosphere.java
 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/InterpolatingMicrosphere.java
index c8929cf..4887d80 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/interpolation/InterpolatingMicrosphere.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/interpolation/InterpolatingMicrosphere.java
@@ -93,8 +93,8 @@ public class InterpolatingMicrosphere {
         this.maxDarkFraction = maxDarkFraction;
         this.darkThreshold = darkThreshold;
         this.background = background;
-        microsphere = new ArrayList<Facet>(size);
-        microsphereData = new ArrayList<FacetData>(size);
+        microsphere = new ArrayList<>(size);
+        microsphereData = new ArrayList<>(size);
     }
 
     /**
@@ -150,7 +150,7 @@ public class InterpolatingMicrosphere {
         microsphere = other.microsphere;
 
         // Field must be copied.
-        microsphereData = new ArrayList<FacetData>(size);
+        microsphereData = new ArrayList<>(size);
         for (FacetData fd : other.microsphereData) {
             microsphereData.add(new FacetData(fd.illumination(), fd.sample()));
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java
 
b/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java
index c406979..92e9e6d 100644
--- 
a/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java
+++ 
b/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java
@@ -51,34 +51,34 @@ public class PolynomialsUtils {
 
         // initialize recurrence for Chebyshev polynomials
         // T0(X) = 1, T1(X) = 0 + 1 * X
-        CHEBYSHEV_COEFFICIENTS = new ArrayList<BigFraction>();
+        CHEBYSHEV_COEFFICIENTS = new ArrayList<>();
         CHEBYSHEV_COEFFICIENTS.add(BigFraction.ONE);
         CHEBYSHEV_COEFFICIENTS.add(BigFraction.ZERO);
         CHEBYSHEV_COEFFICIENTS.add(BigFraction.ONE);
 
         // initialize recurrence for Hermite polynomials
         // H0(X) = 1, H1(X) = 0 + 2 * X
-        HERMITE_COEFFICIENTS = new ArrayList<BigFraction>();
+        HERMITE_COEFFICIENTS = new ArrayList<>();
         HERMITE_COEFFICIENTS.add(BigFraction.ONE);
         HERMITE_COEFFICIENTS.add(BigFraction.ZERO);
         HERMITE_COEFFICIENTS.add(BigFraction.TWO);
 
         // initialize recurrence for Laguerre polynomials
         // L0(X) = 1, L1(X) = 1 - 1 * X
-        LAGUERRE_COEFFICIENTS = new ArrayList<BigFraction>();
+        LAGUERRE_COEFFICIENTS = new ArrayList<>();
         LAGUERRE_COEFFICIENTS.add(BigFraction.ONE);
         LAGUERRE_COEFFICIENTS.add(BigFraction.ONE);
         LAGUERRE_COEFFICIENTS.add(BigFraction.MINUS_ONE);
 
         // initialize recurrence for Legendre polynomials
         // P0(X) = 1, P1(X) = 0 + 1 * X
-        LEGENDRE_COEFFICIENTS = new ArrayList<BigFraction>();
+        LEGENDRE_COEFFICIENTS = new ArrayList<>();
         LEGENDRE_COEFFICIENTS.add(BigFraction.ONE);
         LEGENDRE_COEFFICIENTS.add(BigFraction.ZERO);
         LEGENDRE_COEFFICIENTS.add(BigFraction.ONE);
 
         // initialize map for Jacobi polynomials
-        JACOBI_COEFFICIENTS = new HashMap<JacobiKey, List<BigFraction>>();
+        JACOBI_COEFFICIENTS = new HashMap<>();
 
     }
 
@@ -228,7 +228,7 @@ public class PolynomialsUtils {
         if (!JACOBI_COEFFICIENTS.containsKey(key)) {
 
             // allocate a new list for v, w
-            final List<BigFraction> list = new ArrayList<BigFraction>();
+            final List<BigFraction> list = new ArrayList<>();
             JACOBI_COEFFICIENTS.put(key, list);
 
             // Pv,w,0(x) = 1;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/complex/Complex.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/complex/Complex.java 
b/src/main/java/org/apache/commons/math4/complex/Complex.java
index 5a073c7..48b17fc 100644
--- a/src/main/java/org/apache/commons/math4/complex/Complex.java
+++ b/src/main/java/org/apache/commons/math4/complex/Complex.java
@@ -1209,7 +1209,7 @@ public class Complex implements FieldElement<Complex>, 
Serializable  {
                                            n);
         }
 
-        final List<Complex> result = new ArrayList<Complex>();
+        final List<Complex> result = new ArrayList<>();
 
         if (isNaN) {
             result.add(NaN);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
index 51444b7..755d97e 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
@@ -150,7 +150,7 @@ public class EmpiricalDistribution extends 
AbstractRealDistribution {
             throw new NotStrictlyPositiveException(binCount);
         }
         this.binCount = binCount;
-        binStats = new ArrayList<SummaryStatistics>();
+        binStats = new ArrayList<>();
      }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/EnumeratedDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedDistribution.java
index bfcd1af..f0b6f2e 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedDistribution.java
@@ -84,7 +84,7 @@ public class EnumeratedDistribution<T> implements 
Serializable {
                MathArithmeticException,
                NotFiniteNumberException,
                NotANumberException {
-        singletons = new ArrayList<T>(pmf.size());
+        singletons = new ArrayList<>(pmf.size());
         final double[] probs = new double[pmf.size()];
 
         for (int i = 0; i < pmf.size(); i++) {
@@ -149,10 +149,10 @@ public class EnumeratedDistribution<T> implements 
Serializable {
      * @return the probability mass function.
      */
     public List<Pair<T, Double>> getPmf() {
-        final List<Pair<T, Double>> samples = new ArrayList<Pair<T, 
Double>>(probabilities.length);
+        final List<Pair<T, Double>> samples = new 
ArrayList<>(probabilities.length);
 
         for (int i = 0; i < probabilities.length; i++) {
-            samples.add(new Pair<T, Double>(singletons.get(i), 
probabilities[i]));
+            samples.add(new Pair<>(singletons.get(i), probabilities[i]));
         }
 
         return samples;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java
index 110e408..f507a53 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java
@@ -68,7 +68,7 @@ public class EnumeratedIntegerDistribution extends 
AbstractIntegerDistribution {
                MathArithmeticException,
                NotFiniteNumberException,
                NotANumberException {
-        innerDistribution = new 
EnumeratedDistribution<Integer>(createDistribution(singletons,
+        innerDistribution = new 
EnumeratedDistribution<>(createDistribution(singletons,
                                                                                
    probabilities));
     }
 
@@ -79,7 +79,7 @@ public class EnumeratedIntegerDistribution extends 
AbstractIntegerDistribution {
      * @param data input dataset
      */
     public EnumeratedIntegerDistribution(final int[] data) {
-        final Map<Integer, Integer> dataMap = new HashMap<Integer, Integer>();
+        final Map<Integer, Integer> dataMap = new HashMap<>();
         for (int value : data) {
             Integer count = dataMap.get(value);
             if (count == null) {
@@ -97,7 +97,7 @@ public class EnumeratedIntegerDistribution extends 
AbstractIntegerDistribution {
             probabilities[index] = entry.getValue().intValue() / denom;
             index++;
         }
-        innerDistribution = new 
EnumeratedDistribution<Integer>(createDistribution(values, probabilities));
+        innerDistribution = new 
EnumeratedDistribution<>(createDistribution(values, probabilities));
     }
 
     /**
@@ -112,10 +112,10 @@ public class EnumeratedIntegerDistribution extends 
AbstractIntegerDistribution {
             throw new DimensionMismatchException(probabilities.length, 
singletons.length);
         }
 
-        final List<Pair<Integer, Double>> samples = new 
ArrayList<Pair<Integer, Double>>(singletons.length);
+        final List<Pair<Integer, Double>> samples = new 
ArrayList<>(singletons.length);
 
         for (int i = 0; i < singletons.length; i++) {
-            samples.add(new Pair<Integer, Double>(singletons[i], 
probabilities[i]));
+            samples.add(new Pair<>(singletons[i], probabilities[i]));
         }
         return samples;
     }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java
index b21b994..f54663b 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java
@@ -72,7 +72,7 @@ public class EnumeratedRealDistribution extends 
AbstractRealDistribution {
                MathArithmeticException,
                NotFiniteNumberException,
                NotANumberException {
-        innerDistribution = new 
EnumeratedDistribution<Double>(createDistribution(singletons, probabilities));
+        innerDistribution = new 
EnumeratedDistribution<>(createDistribution(singletons, probabilities));
     }
 
     /**
@@ -82,7 +82,7 @@ public class EnumeratedRealDistribution extends 
AbstractRealDistribution {
      * @param data input dataset
      */
     public EnumeratedRealDistribution(final double[] data) {
-        final Map<Double, Integer> dataMap = new HashMap<Double, Integer>();
+        final Map<Double, Integer> dataMap = new HashMap<>();
         for (double value : data) {
             Integer count = dataMap.get(value);
             if (count == null) {
@@ -100,7 +100,7 @@ public class EnumeratedRealDistribution extends 
AbstractRealDistribution {
             probabilities[index] = entry.getValue().intValue() / denom;
             index++;
         }
-        innerDistribution = new 
EnumeratedDistribution<Double>(createDistribution(values, probabilities));
+        innerDistribution = new 
EnumeratedDistribution<>(createDistribution(values, probabilities));
     }
 
     /**
@@ -115,10 +115,10 @@ public class EnumeratedRealDistribution extends 
AbstractRealDistribution {
             throw new DimensionMismatchException(probabilities.length, 
singletons.length);
         }
 
-        final List<Pair<Double, Double>> samples = new ArrayList<Pair<Double, 
Double>>(singletons.length);
+        final List<Pair<Double, Double>> samples = new 
ArrayList<>(singletons.length);
 
         for (int i = 0; i < singletons.length; i++) {
-            samples.add(new Pair<Double, Double>(singletons[i], 
probabilities[i]));
+            samples.add(new Pair<>(singletons[i], probabilities[i]));
         }
         return samples;
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistribution.java
index e24a2ac..4ae44f5 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateNormalDistribution.java
@@ -77,13 +77,13 @@ public class MixtureMultivariateNormalDistribution
                                                                                
        double[][] means,
                                                                                
        double[][][] covariances) {
         final List<Pair<Double, MultivariateNormalDistribution>> mvns
-            = new ArrayList<Pair<Double, 
MultivariateNormalDistribution>>(weights.length);
+            = new ArrayList<>(weights.length);
 
         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 mvns;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateRealDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateRealDistribution.java
 
b/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateRealDistribution.java
index 893c543..0fdff80 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateRealDistribution.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/MixtureMultivariateRealDistribution.java
@@ -73,7 +73,7 @@ public class MixtureMultivariateRealDistribution<T extends 
MultivariateRealDistr
         }
 
         // Store each distribution and its normalized weight.
-        distribution = new ArrayList<T>();
+        distribution = new ArrayList<>();
         weight = new double[numComp];
         for (int i = 0; i < numComp; i++) {
             final Pair<Double, T> comp = components.get(i);
@@ -98,10 +98,10 @@ public class MixtureMultivariateRealDistribution<T extends 
MultivariateRealDistr
      * @return the component distributions and associated weights.
      */
     public List<Pair<Double, T>> getComponents() {
-        final List<Pair<Double, T>> list = new ArrayList<Pair<Double, 
T>>(weight.length);
+        final List<Pair<Double, T>> list = new ArrayList<>(weight.length);
 
         for (int i = 0; i < weight.length; i++) {
-            list.add(new Pair<Double, T>(weight[i], distribution.get(i)));
+            list.add(new Pair<>(weight[i], distribution.get(i)));
         }
 
         return list;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximization.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximization.java
 
b/src/main/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximization.java
index a0cf248..20cbfc2 100644
--- 
a/src/main/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximization.java
+++ 
b/src/main/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximization.java
@@ -328,7 +328,7 @@ public class 
MultivariateNormalMixtureExpectationMaximization {
 
         // components of mixture model to be created
         final List<Pair<Double, MultivariateNormalDistribution>> components =
-                new ArrayList<Pair<Double, 
MultivariateNormalDistribution>>(numComponents);
+                new ArrayList<>(numComponents);
 
         // create a component based on data in each bin
         for (int binIndex = 0; binIndex < numComponents; binIndex++) {
@@ -364,7 +364,7 @@ public class 
MultivariateNormalMixtureExpectationMaximization {
             final MultivariateNormalDistribution mvn
                 = new MultivariateNormalDistribution(columnMeans, covMat);
 
-            components.add(new Pair<Double, 
MultivariateNormalDistribution>(weight, mvn));
+            components.add(new Pair<>(weight, mvn));
         }
 
         return new MixtureMultivariateNormalDistribution(components);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/exception/util/ArgUtils.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/exception/util/ArgUtils.java 
b/src/main/java/org/apache/commons/math4/exception/util/ArgUtils.java
index 577b0a5..6e447a0 100644
--- a/src/main/java/org/apache/commons/math4/exception/util/ArgUtils.java
+++ b/src/main/java/org/apache/commons/math4/exception/util/ArgUtils.java
@@ -38,7 +38,7 @@ public class ArgUtils {
      * {@code array}.
      */
     public static Object[] flatten(Object[] array) {
-        final List<Object> list = new ArrayList<Object>();
+        final List<Object> list = new ArrayList<>();
         if (array != null) {
             for (Object o : array) {
                 if (o instanceof Object[]) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/exception/util/ExceptionContext.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/exception/util/ExceptionContext.java 
b/src/main/java/org/apache/commons/math4/exception/util/ExceptionContext.java
index 59f91a3..4cdde9a 100644
--- 
a/src/main/java/org/apache/commons/math4/exception/util/ExceptionContext.java
+++ 
b/src/main/java/org/apache/commons/math4/exception/util/ExceptionContext.java
@@ -62,9 +62,9 @@ public class ExceptionContext implements Serializable {
      */
     public ExceptionContext(final Throwable throwable) {
         this.throwable = throwable;
-        msgPatterns    = new ArrayList<Localizable>();
-        msgArguments   = new ArrayList<Object[]>();
-        context        = new HashMap<String, Object>();
+        msgPatterns    = new ArrayList<>();
+        msgArguments   = new ArrayList<>();
+        context        = new HashMap<>();
     }
 
     /** Get a reference to the exception to which the context relates.
@@ -256,8 +256,8 @@ public class ExceptionContext implements Serializable {
                ClassNotFoundException {
         // Step 1.
         final int len = in.readInt();
-        msgPatterns = new ArrayList<Localizable>(len);
-        msgArguments = new ArrayList<Object[]>(len);
+        msgPatterns = new ArrayList<>(len);
+        msgArguments = new ArrayList<>(len);
         // Step 2.
         for (int i = 0; i < len; i++) {
             // Step 3.
@@ -311,7 +311,7 @@ public class ExceptionContext implements Serializable {
                ClassNotFoundException {
         // Step 1.
         final int len = in.readInt();
-        context = new HashMap<String, Object>();
+        context = new HashMap<>();
         for (int i = 0; i < len; i++) {
             // Step 2.
             final String key = (String) in.readObject();

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java 
b/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
index ae2b8d8..3c5f14a 100644
--- a/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
+++ b/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
@@ -248,7 +248,7 @@ public class GaussianCurveFitter extends 
AbstractCurveFitter {
          * @return the input observations, sorted.
          */
         private List<WeightedObservedPoint> 
sortObservations(Collection<WeightedObservedPoint> unsorted) {
-            final List<WeightedObservedPoint> observations = new 
ArrayList<WeightedObservedPoint>(unsorted);
+            final List<WeightedObservedPoint> observations = new 
ArrayList<>(unsorted);
 
             final Comparator<WeightedObservedPoint> cmp = new 
Comparator<WeightedObservedPoint>() {
                 /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/fitting/HarmonicCurveFitter.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/fitting/HarmonicCurveFitter.java 
b/src/main/java/org/apache/commons/math4/fitting/HarmonicCurveFitter.java
index c8a2a8e..fbd643f 100644
--- a/src/main/java/org/apache/commons/math4/fitting/HarmonicCurveFitter.java
+++ b/src/main/java/org/apache/commons/math4/fitting/HarmonicCurveFitter.java
@@ -292,7 +292,7 @@ public class HarmonicCurveFitter extends 
AbstractCurveFitter {
          * @return the input observations, sorted.
          */
         private List<WeightedObservedPoint> 
sortObservations(Collection<WeightedObservedPoint> unsorted) {
-            final List<WeightedObservedPoint> observations = new 
ArrayList<WeightedObservedPoint>(unsorted);
+            final List<WeightedObservedPoint> observations = new 
ArrayList<>(unsorted);
 
             // Since the samples are almost always already sorted, this
             // method is implemented as an insertion sort that reorders the

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/fitting/WeightedObservedPoints.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/fitting/WeightedObservedPoints.java 
b/src/main/java/org/apache/commons/math4/fitting/WeightedObservedPoints.java
index 520af88..00cef70 100644
--- a/src/main/java/org/apache/commons/math4/fitting/WeightedObservedPoints.java
+++ b/src/main/java/org/apache/commons/math4/fitting/WeightedObservedPoints.java
@@ -32,7 +32,7 @@ public class WeightedObservedPoints implements Serializable {
 
     /** Observed points. */
     private final List<WeightedObservedPoint> observations
-        = new ArrayList<WeightedObservedPoint>();
+        = new ArrayList<>();
 
     /**
      * Adds a point to the sample.
@@ -100,7 +100,7 @@ public class WeightedObservedPoints implements Serializable 
{
         // The copy is necessary to ensure thread-safety because of the
         // "clear" method (which otherwise would be able to empty the
         // list of points while it is being used by another thread).
-        return new ArrayList<WeightedObservedPoint>(observations);
+        return new ArrayList<>(observations);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/fitting/leastsquares/GaussNewtonOptimizer.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/fitting/leastsquares/GaussNewtonOptimizer.java
 
b/src/main/java/org/apache/commons/math4/fitting/leastsquares/GaussNewtonOptimizer.java
index ec17b93..637382c 100644
--- 
a/src/main/java/org/apache/commons/math4/fitting/leastsquares/GaussNewtonOptimizer.java
+++ 
b/src/main/java/org/apache/commons/math4/fitting/leastsquares/GaussNewtonOptimizer.java
@@ -294,7 +294,7 @@ public class GaussNewtonOptimizer implements 
LeastSquaresOptimizer {
                 normal.setEntry(i, j, normal.getEntry(j, i));
             }
         }
-        return new Pair<RealMatrix, RealVector>(normal, jTr);
+        return new Pair<>(normal, jTr);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
 
b/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
index a0ddace..933278d 100644
--- 
a/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
+++ 
b/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
@@ -332,7 +332,7 @@ public class LeastSquaresFactory {
             final double[] p = point.toArray();
 
             // Evaluate.
-            return new Pair<RealVector, RealMatrix>(computeValue(p),
+            return new Pair<>(computeValue(p),
                                                     computeJacobian(p));
         }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/AbstractListChromosome.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/AbstractListChromosome.java 
b/src/main/java/org/apache/commons/math4/genetics/AbstractListChromosome.java
index 707ddd5..e7ac9a8 100644
--- 
a/src/main/java/org/apache/commons/math4/genetics/AbstractListChromosome.java
+++ 
b/src/main/java/org/apache/commons/math4/genetics/AbstractListChromosome.java
@@ -59,7 +59,7 @@ public abstract class AbstractListChromosome<T> extends 
Chromosome {
     public AbstractListChromosome(final List<T> representation, final boolean 
copyList) {
         checkValidity(representation);
         this.representation =
-                Collections.unmodifiableList(copyList ? new 
ArrayList<T>(representation) : representation);
+                Collections.unmodifiableList(copyList ? new 
ArrayList<>(representation) : representation);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/BinaryChromosome.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/BinaryChromosome.java 
b/src/main/java/org/apache/commons/math4/genetics/BinaryChromosome.java
index b4aa232..6f1e08c 100644
--- a/src/main/java/org/apache/commons/math4/genetics/BinaryChromosome.java
+++ b/src/main/java/org/apache/commons/math4/genetics/BinaryChromosome.java
@@ -67,7 +67,7 @@ public abstract class BinaryChromosome extends 
AbstractListChromosome<Integer> {
      */
     public static List<Integer> randomBinaryRepresentation(int length) {
         // random binary list
-        List<Integer> rList= new ArrayList<Integer> (length);
+        List<Integer> rList= new ArrayList<> (length);
         for (int j=0; j<length; j++) {
             rList.add(GeneticAlgorithm.getRandomGenerator().nextInt(2));
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/BinaryMutation.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/BinaryMutation.java 
b/src/main/java/org/apache/commons/math4/genetics/BinaryMutation.java
index 33c5ac5..d4afd75 100644
--- a/src/main/java/org/apache/commons/math4/genetics/BinaryMutation.java
+++ b/src/main/java/org/apache/commons/math4/genetics/BinaryMutation.java
@@ -43,7 +43,7 @@ public class BinaryMutation implements MutationPolicy {
         }
 
         BinaryChromosome origChrom = (BinaryChromosome) original;
-        List<Integer> newRepr = new 
ArrayList<Integer>(origChrom.getRepresentation());
+        List<Integer> newRepr = new ArrayList<>(origChrom.getRepresentation());
 
         // randomly select a gene
         int geneIndex = 
GeneticAlgorithm.getRandomGenerator().nextInt(origChrom.getLength());

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/CycleCrossover.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/CycleCrossover.java 
b/src/main/java/org/apache/commons/math4/genetics/CycleCrossover.java
index 507ffdf..0de8371 100644
--- a/src/main/java/org/apache/commons/math4/genetics/CycleCrossover.java
+++ b/src/main/java/org/apache/commons/math4/genetics/CycleCrossover.java
@@ -129,13 +129,13 @@ public class CycleCrossover<T> implements CrossoverPolicy 
{
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children: do a crossover copy to simplify the later 
processing
-        final List<T> child1Rep = new ArrayList<T>(second.getRepresentation());
-        final List<T> child2Rep = new ArrayList<T>(first.getRepresentation());
+        final List<T> child1Rep = new ArrayList<>(second.getRepresentation());
+        final List<T> child2Rep = new ArrayList<>(first.getRepresentation());
 
         // the set of all visited indices so far
-        final Set<Integer> visitedIndices = new HashSet<Integer>(length);
+        final Set<Integer> visitedIndices = new HashSet<>(length);
         // the indices of the current cycle
-        final List<Integer> indices = new ArrayList<Integer>(length);
+        final List<Integer> indices = new ArrayList<>(length);
 
         // determine the starting index
         int idx = randomStart ? 
GeneticAlgorithm.getRandomGenerator().nextInt(length) : 0;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/ListPopulation.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/ListPopulation.java 
b/src/main/java/org/apache/commons/math4/genetics/ListPopulation.java
index 1adf6ac..0aa0239 100644
--- a/src/main/java/org/apache/commons/math4/genetics/ListPopulation.java
+++ b/src/main/java/org/apache/commons/math4/genetics/ListPopulation.java
@@ -76,7 +76,7 @@ public abstract class ListPopulation implements Population {
                                                 chromosomes.size(), 
populationLimit, false);
         }
         this.populationLimit = populationLimit;
-        this.chromosomes = new ArrayList<Chromosome>(populationLimit);
+        this.chromosomes = new ArrayList<>(populationLimit);
         this.chromosomes.addAll(chromosomes);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/NPointCrossover.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/NPointCrossover.java 
b/src/main/java/org/apache/commons/math4/genetics/NPointCrossover.java
index 6a497ab..bc94581 100644
--- a/src/main/java/org/apache/commons/math4/genetics/NPointCrossover.java
+++ b/src/main/java/org/apache/commons/math4/genetics/NPointCrossover.java
@@ -139,8 +139,8 @@ public class NPointCrossover<T> implements CrossoverPolicy {
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final List<T> child1Rep = new ArrayList<T>(length);
-        final List<T> child2Rep = new ArrayList<T>(length);
+        final List<T> child1Rep = new ArrayList<>(length);
+        final List<T> child2Rep = new ArrayList<>(length);
 
         final UniformRandomProvider random = 
GeneticAlgorithm.getRandomGenerator();
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/OnePointCrossover.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/OnePointCrossover.java 
b/src/main/java/org/apache/commons/math4/genetics/OnePointCrossover.java
index 0df7313..7308043 100644
--- a/src/main/java/org/apache/commons/math4/genetics/OnePointCrossover.java
+++ b/src/main/java/org/apache/commons/math4/genetics/OnePointCrossover.java
@@ -105,8 +105,8 @@ public class OnePointCrossover<T> implements 
CrossoverPolicy {
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final List<T> child1Rep = new ArrayList<T>(length);
-        final List<T> child2Rep = new ArrayList<T>(length);
+        final List<T> child1Rep = new ArrayList<>(length);
+        final List<T> child2Rep = new ArrayList<>(length);
 
         // select a crossover point at random (0 and length makes no sense)
         final int crossoverIndex = 1 + 
(GeneticAlgorithm.getRandomGenerator().nextInt(length-2));

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/OrderedCrossover.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/OrderedCrossover.java 
b/src/main/java/org/apache/commons/math4/genetics/OrderedCrossover.java
index a1e7772..803c724 100644
--- a/src/main/java/org/apache/commons/math4/genetics/OrderedCrossover.java
+++ b/src/main/java/org/apache/commons/math4/genetics/OrderedCrossover.java
@@ -97,11 +97,11 @@ public class OrderedCrossover<T> implements CrossoverPolicy 
{
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final List<T> child1 = new ArrayList<T>(length);
-        final List<T> child2 = new ArrayList<T>(length);
+        final List<T> child1 = new ArrayList<>(length);
+        final List<T> child2 = new ArrayList<>(length);
         // sets of already inserted items for quick access
-        final Set<T> child1Set = new HashSet<T>(length);
-        final Set<T> child2Set = new HashSet<T>(length);
+        final Set<T> child1Set = new HashSet<>(length);
+        final Set<T> child2Set = new HashSet<>(length);
 
         final UniformRandomProvider random = 
GeneticAlgorithm.getRandomGenerator();
         // choose random points, making sure that lb < ub.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/RandomKey.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/genetics/RandomKey.java 
b/src/main/java/org/apache/commons/math4/genetics/RandomKey.java
index 8186a52..ea0a401 100644
--- a/src/main/java/org/apache/commons/math4/genetics/RandomKey.java
+++ b/src/main/java/org/apache/commons/math4/genetics/RandomKey.java
@@ -72,7 +72,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
     public RandomKey(final List<Double> representation) throws 
InvalidRepresentationException {
         super(representation);
         // store the sorted representation
-        List<Double> sortedRepr = new ArrayList<Double> (getRepresentation());
+        List<Double> sortedRepr = new ArrayList<> (getRepresentation());
         Collections.sort(sortedRepr);
         sortedRepresentation = Collections.unmodifiableList(sortedRepr);
         // store the permutation of [0,1,...,n-1] list for toString() and 
isSame() methods
@@ -126,10 +126,10 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
         }
 
         // do not modify the original representation
-        List<Double> reprCopy = new ArrayList<Double> (representation);
+        List<Double> reprCopy = new ArrayList<> (representation);
 
         // now find the indices in the original repr and use them for permuting
-        List<S> res = new ArrayList<S> (l);
+        List<S> res = new ArrayList<> (l);
         for (int i=0; i<l; i++) {
             int index = reprCopy.indexOf(sortedRepr.get(i));
             res.add(sequence.get(index));
@@ -195,7 +195,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
      * @return representation of a random permutation
      */
     public static final List<Double> randomPermutation(final int l) {
-        List<Double> repr = new ArrayList<Double>(l);
+        List<Double> repr = new ArrayList<>(l);
         for (int i=0; i<l; i++) {
             repr.add(GeneticAlgorithm.getRandomGenerator().nextDouble());
         }
@@ -210,7 +210,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
      * @return representation of an identity permutation
      */
     public static final List<Double> identityPermutation(final int l) {
-        List<Double> repr = new ArrayList<Double>(l);
+        List<Double> repr = new ArrayList<>(l);
         for (int i=0; i<l; i++) {
             repr.add((double)i/l);
         }
@@ -232,7 +232,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
      */
     public static <S> List<Double> comparatorPermutation(final List<S> data,
                                                          final Comparator<S> 
comparator) {
-        List<S> sortedData = new ArrayList<S>(data);
+        List<S> sortedData = new ArrayList<>(data);
         Collections.sort(sortedData, comparator);
 
         return inducedPermutation(data, sortedData);
@@ -264,7 +264,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
         }
         int l = originalData.size();
 
-        List<S> origDataCopy = new ArrayList<S> (originalData);
+        List<S> origDataCopy = new ArrayList<> (originalData);
 
         Double[] res = new Double[l];
         for (int i=0; i<l; i++) {
@@ -291,7 +291,7 @@ public abstract class RandomKey<T> extends 
AbstractListChromosome<Double> implem
      * @return list of integers from 0 to l-1
      */
     private static List<Integer> baseSequence(final int l) {
-        List<Integer> baseSequence = new ArrayList<Integer> (l);
+        List<Integer> baseSequence = new ArrayList<> (l);
         for (int i=0; i<l; i++) {
             baseSequence.add(i);
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/RandomKeyMutation.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/RandomKeyMutation.java 
b/src/main/java/org/apache/commons/math4/genetics/RandomKeyMutation.java
index ef74a28..3080ffc 100644
--- a/src/main/java/org/apache/commons/math4/genetics/RandomKeyMutation.java
+++ b/src/main/java/org/apache/commons/math4/genetics/RandomKeyMutation.java
@@ -46,7 +46,7 @@ public class RandomKeyMutation implements MutationPolicy {
         List<Double> repr = originalRk.getRepresentation();
         int rInd = GeneticAlgorithm.getRandomGenerator().nextInt(repr.size());
 
-        List<Double> newRepr = new ArrayList<Double> (repr);
+        List<Double> newRepr = new ArrayList<> (repr);
         newRepr.set(rInd, GeneticAlgorithm.getRandomGenerator().nextDouble());
 
         return originalRk.newFixedLengthChromosome(newRepr);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/TournamentSelection.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/TournamentSelection.java 
b/src/main/java/org/apache/commons/math4/genetics/TournamentSelection.java
index 97becff..0924033 100644
--- a/src/main/java/org/apache/commons/math4/genetics/TournamentSelection.java
+++ b/src/main/java/org/apache/commons/math4/genetics/TournamentSelection.java
@@ -84,7 +84,7 @@ public class TournamentSelection implements SelectionPolicy {
         };
 
         // create a copy of the chromosome list
-        List<Chromosome> chromosomes = new ArrayList<Chromosome> 
(population.getChromosomes());
+        List<Chromosome> chromosomes = new ArrayList<> 
(population.getChromosomes());
         for (int i=0; i<this.arity; i++) {
             // select a random individual and add it to the tournament
             int rind = 
GeneticAlgorithm.getRandomGenerator().nextInt(chromosomes.size());

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/genetics/UniformCrossover.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/genetics/UniformCrossover.java 
b/src/main/java/org/apache/commons/math4/genetics/UniformCrossover.java
index 74fac3d..76c48e0 100644
--- a/src/main/java/org/apache/commons/math4/genetics/UniformCrossover.java
+++ b/src/main/java/org/apache/commons/math4/genetics/UniformCrossover.java
@@ -112,8 +112,8 @@ public class UniformCrossover<T> implements CrossoverPolicy 
{
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final List<T> child1Rep = new ArrayList<T>(length);
-        final List<T> child2Rep = new ArrayList<T>(length);
+        final List<T> child1Rep = new ArrayList<>(length);
+        final List<T> child2Rep = new ArrayList<>(length);
 
         final UniformRandomProvider random = 
GeneticAlgorithm.getRandomGenerator();
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser.java 
b/src/main/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser.java
index 9cd1112..b76ff6a 100644
--- 
a/src/main/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser.java
+++ 
b/src/main/java/org/apache/commons/math4/geometry/enclosing/WelzlEncloser.java
@@ -78,8 +78,8 @@ public class WelzlEncloser<S extends Space, P extends 
Point<S>> implements Enclo
     private EnclosingBall<S, P> pivotingBall(final Iterable<P> points) {
 
         final P first = points.iterator().next();
-        final List<P> extreme = new 
ArrayList<P>(first.getSpace().getDimension() + 1);
-        final List<P> support = new 
ArrayList<P>(first.getSpace().getDimension() + 1);
+        final List<P> extreme = new 
ArrayList<>(first.getSpace().getDimension() + 1);
+        final List<P> support = new 
ArrayList<>(first.getSpace().getDimension() + 1);
 
         // start with only first point selected as a candidate support
         extreme.add(first);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/IntervalsSet.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/IntervalsSet.java
 
b/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/IntervalsSet.java
index 7d944af..1b58cd9 100644
--- 
a/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/IntervalsSet.java
+++ 
b/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/IntervalsSet.java
@@ -108,12 +108,12 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
         if (Double.isInfinite(lower) && (lower < 0)) {
             if (Double.isInfinite(upper) && (upper > 0)) {
                 // the tree must cover the whole real line
-                return new BSPTree<Euclidean1D>(Boolean.TRUE);
+                return new BSPTree<>(Boolean.TRUE);
             }
             // the tree must be open on the negative infinity side
             final SubHyperplane<Euclidean1D> upperCut =
                 new OrientedPoint(new Vector1D(upper), true, 
tolerance).wholeHyperplane();
-            return new BSPTree<Euclidean1D>(upperCut,
+            return new BSPTree<>(upperCut,
                                new BSPTree<Euclidean1D>(Boolean.FALSE),
                                new BSPTree<Euclidean1D>(Boolean.TRUE),
                                null);
@@ -122,7 +122,7 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
             new OrientedPoint(new Vector1D(lower), false, 
tolerance).wholeHyperplane();
         if (Double.isInfinite(upper) && (upper > 0)) {
             // the tree must be open on the positive infinity side
-            return new BSPTree<Euclidean1D>(lowerCut,
+            return new BSPTree<>(lowerCut,
                                             new 
BSPTree<Euclidean1D>(Boolean.FALSE),
                                             new 
BSPTree<Euclidean1D>(Boolean.TRUE),
                                             null);
@@ -131,9 +131,9 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
         // the tree must be bounded on the two sides
         final SubHyperplane<Euclidean1D> upperCut =
             new OrientedPoint(new Vector1D(upper), true, 
tolerance).wholeHyperplane();
-        return new BSPTree<Euclidean1D>(lowerCut,
+        return new BSPTree<>(lowerCut,
                                         new 
BSPTree<Euclidean1D>(Boolean.FALSE),
-                                        new BSPTree<Euclidean1D>(upperCut,
+                                        new BSPTree<>(upperCut,
                                                                  new 
BSPTree<Euclidean1D>(Boolean.FALSE),
                                                                  new 
BSPTree<Euclidean1D>(Boolean.TRUE),
                                                                  null),
@@ -222,9 +222,9 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
                 final double previousOffset = x - previous;
                 final double currentOffset  = a[0] - x;
                 if (previousOffset < currentOffset) {
-                    return new BoundaryProjection<Euclidean1D>(point, 
finiteOrNullPoint(previous), previousOffset);
+                    return new BoundaryProjection<>(point, 
finiteOrNullPoint(previous), previousOffset);
                 } else {
-                    return new BoundaryProjection<Euclidean1D>(point, 
finiteOrNullPoint(a[0]), currentOffset);
+                    return new BoundaryProjection<>(point, 
finiteOrNullPoint(a[0]), currentOffset);
                 }
             } else if (x <= a[1]) {
                 // the test point lies within the current interval
@@ -232,16 +232,16 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
                 final double offset0 = a[0] - x;
                 final double offset1 = x - a[1];
                 if (offset0 < offset1) {
-                    return new BoundaryProjection<Euclidean1D>(point, 
finiteOrNullPoint(a[1]), offset1);
+                    return new BoundaryProjection<>(point, 
finiteOrNullPoint(a[1]), offset1);
                 } else {
-                    return new BoundaryProjection<Euclidean1D>(point, 
finiteOrNullPoint(a[0]), offset0);
+                    return new BoundaryProjection<>(point, 
finiteOrNullPoint(a[0]), offset0);
                 }
             }
             previous = a[1];
         }
 
         // the test point if past the last sub-interval
-        return new BoundaryProjection<Euclidean1D>(point, 
finiteOrNullPoint(previous), x - previous);
+        return new BoundaryProjection<>(point, finiteOrNullPoint(previous), x 
- previous);
 
     }
 
@@ -267,7 +267,7 @@ public class IntervalsSet extends 
AbstractRegion<Euclidean1D, Euclidean1D> imple
      * elements
      */
     public List<Interval> asList() {
-        final List<Interval> list = new ArrayList<Interval>();
+        final List<Interval> list = new ArrayList<>();
         for (final double[] a : this) {
             list.add(new Interval(a[0], a[1]));
         }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/762eb53f/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/SubOrientedPoint.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/SubOrientedPoint.java
 
b/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/SubOrientedPoint.java
index a80873d..878c046 100644
--- 
a/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/SubOrientedPoint.java
+++ 
b/src/main/java/org/apache/commons/math4/geometry/euclidean/oned/SubOrientedPoint.java
@@ -61,11 +61,11 @@ public class SubOrientedPoint extends 
AbstractSubHyperplane<Euclidean1D, Euclide
     public SplitSubHyperplane<Euclidean1D> split(final Hyperplane<Euclidean1D> 
hyperplane) {
         final double global = hyperplane.getOffset(((OrientedPoint) 
getHyperplane()).getLocation());
         if (global < -1.0e-10) {
-            return new SplitSubHyperplane<Euclidean1D>(null, this);
+            return new SplitSubHyperplane<>(null, this);
         } else if (global > 1.0e-10) {
-            return new SplitSubHyperplane<Euclidean1D>(this, null);
+            return new SplitSubHyperplane<>(this, null);
         } else {
-            return new SplitSubHyperplane<Euclidean1D>(null, null);
+            return new SplitSubHyperplane<>(null, null);
         }
     }
 

Reply via email to