public void addAll(StatsBuckets other) {
        checkArgument(boundaries.length == other.boundaries.length,
                "boundaries size %s doesn't match with given boundaries size %s", boundaries.length,
                other.boundaries.length);

        for (int i = 0; i < buckets.length; i++) {
            buckets[i].add(other.values[i]);
        }

        sumCounter.add(other.sum);
    }
@Test
    public void testAddAll() {
        StatsBuckets stats = new StatsBuckets(10, 20, 30);
        stats.addValue(1);
        stats.addValue(2);
        stats.refresh();
        StatsBuckets stats2 = new StatsBuckets(10, 20, 30);
        stats2.addAll(stats);
        stats2.refresh();
        assertEquals(stats2.getSum(),3);
        assertEquals(stats2.getCount(),2);
    }