GaussianCurveFitter extends AbstractCurveFitter { public GaussianCurveFitter withStartPoint(double[] newStart) { return new GaussianCurveFitter(newStart.clone(), maxIter); } private  GaussianCurveFitter(double[] initialGuess,
                                int maxIter); static GaussianCurveFitter create(); GaussianCurveFitter withStartPoint(double[] newStart); GaussianCurveFitter withMaxIterations(int newMaxIter);  }
@Test public void testWithStartPoint() { final double[] init = { 3.5e6, 4.2, 0.1 }; GaussianCurveFitter fitter = GaussianCurveFitter.create(); double[] parameters = fitter .withStartPoint(init) .fit(createDataset(DATASET1).toList()); Assert.assertEquals(3496978.1837704973, parameters[0], 1e-2); Assert.assertEquals(4.054933085999146, parameters[1], 1e-4); Assert.assertEquals(0.015039355620304326, parameters[2], 1e-4); }