### Question:
Statistics extends AbstractProcess { private void mergeHistograms(NumericHistogram[] histo, NumericHistogram[] tileHisto) { for (int i = 0; i < histo.length; i++) { NumericHistogram histo1 = histo[i]; NumericHistogram histo2 = tileHisto[i]; histo[i] = mergeHistograms(histo1, histo2); } } Statistics(final RenderedImage image, boolean excludeNoData);  Statistics(final GridCoverage coverage, boolean excludeNoData);  Statistics(final GridCoverageResource ref, boolean excludeNoData);  Statistics(final ParameterValueGroup input); static ImageStatistics analyse(RenderedImage image, boolean excludeNoData);  }### Answer:
@Test public void mergeHistogramTest() { long[] expectHisto = new long[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; long[] expectMerge = new long[] {3, 2, 2, 2, 2, 2, 2, 2, 2, 1}; NumericHistogram histo1 = new NumericHistogram(10, 0.0, 10.0); NumericHistogram histo2 = new NumericHistogram(10, 1.0, 11.0); for (long i = 0; i < 10; i++) { histo1.addValue((double)i, 1); histo2.addValue((double)i+histo2.getMin(), 1); } Assert.assertArrayEquals(expectHisto, histo1.getHist()); Assert.assertArrayEquals(expectHisto, histo2.getHist()); NumericHistogram merged = Statistics.mergeHistograms(histo1, histo2); Assert.assertArrayEquals(expectMerge, merged.getHist()); expectMerge = new long[] {2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; histo1 = new NumericHistogram(10, 0.0, 10.0); histo2 = new NumericHistogram(10, 0.0, 10.0); for (long i = 0; i < 10; i++) { histo1.addValue((double)i, 1); histo2.addValue((double)i+histo2.getMin(), 1); } Assert.assertArrayEquals(expectHisto, histo1.getHist()); Assert.assertArrayEquals(expectHisto, histo2.getHist()); merged = Statistics.mergeHistograms(histo1, histo2); Assert.assertArrayEquals(expectMerge, merged.getHist()); expectMerge = new long[] {3, 2, 3, 2, 0, 0, 3, 2, 3, 2}; histo1 = new NumericHistogram(10, 0.0, 10.0); histo2 = new NumericHistogram(10, 15.0, 25.0); for (long i = 0; i < 10; i++) { histo1.addValue((double)i, 1); histo2.addValue((double)i+histo2.getMin(), 1); } Assert.assertArrayEquals(expectHisto, histo1.getHist()); Assert.assertArrayEquals(expectHisto, histo2.getHist()); merged = Statistics.mergeHistograms(histo1, histo2); Assert.assertArrayEquals(expectMerge, merged.getHist()); }