SummaryStatistics implements StatisticalSummary, Serializable { public SummaryStatistics copy() { SummaryStatistics result = new SummaryStatistics(); copy(this, result); return result; } SummaryStatistics();  SummaryStatistics(SummaryStatistics original); StatisticalSummary getSummary(); void addValue(double value); long getN(); double getSum(); double getSumsq(); double getMean(); double getStandardDeviation(); double getVariance(); double getPopulationVariance(); double getMax(); double getMin(); double getGeometricMean(); double getSumOfLogs(); double getSecondMoment(); @Override String toString(); void clear(); @Override boolean equals(Object object); @Override int hashCode(); StorelessUnivariateStatistic getSumImpl(); void setSumImpl(StorelessUnivariateStatistic sumImpl); StorelessUnivariateStatistic getSumsqImpl(); void setSumsqImpl(StorelessUnivariateStatistic sumsqImpl); StorelessUnivariateStatistic getMinImpl(); void setMinImpl(StorelessUnivariateStatistic minImpl); StorelessUnivariateStatistic getMaxImpl(); void setMaxImpl(StorelessUnivariateStatistic maxImpl); StorelessUnivariateStatistic getSumLogImpl(); void setSumLogImpl(StorelessUnivariateStatistic sumLogImpl); StorelessUnivariateStatistic getGeoMeanImpl(); void setGeoMeanImpl(StorelessUnivariateStatistic geoMeanImpl); StorelessUnivariateStatistic getMeanImpl(); void setMeanImpl(StorelessUnivariateStatistic meanImpl); StorelessUnivariateStatistic getVarianceImpl(); void setVarianceImpl(StorelessUnivariateStatistic varianceImpl); SummaryStatistics copy(); static void copy(SummaryStatistics source, SummaryStatistics dest);  }
@Test public void testCopy() { SummaryStatistics u = createSummaryStatistics(); u.addValue(2d); u.addValue(1d); u.addValue(3d); u.addValue(4d); SummaryStatistics v = new SummaryStatistics(u); Assert.assertEquals(u, v); Assert.assertEquals(v, u); u.addValue(7d); u.addValue(9d); u.addValue(11d); u.addValue(23d); v.addValue(7d); v.addValue(9d); v.addValue(11d); v.addValue(23d); Assert.assertEquals(u, v); Assert.assertEquals(v, u); u.clear(); u.setSumImpl(new Sum()); SummaryStatistics.copy(u,v); Assert.assertEquals(u.getSumImpl(), v.getSumImpl()); }