@Override
    public void accept(final MeterEntity entity, final BucketedValues value) {
        if (dataset.size() > 0) {
            if (!value.isCompatible(dataset)) {
                throw new IllegalArgumentException(
                    "Incompatible BucketedValues [" + value + "] for current HistogramFunction[" + dataset + "]");
            }
        }

        this.entityId = entity.id();

        final long[] values = value.getValues();
        for (int i = 0; i < values.length; i++) {
            final long bucket = value.getBuckets()[i];
            String bucketName = bucket == Long.MIN_VALUE ? Bucket.INFINITE_NEGATIVE : String.valueOf(bucket);
            final long bucketValue = values[i];
            dataset.valueAccumulation(bucketName, bucketValue);
        }
    }
@Test
    public void testIncompatible() {
        assertThrows(IllegalArgumentException.class, () -> {
            HistogramFunctionInst inst = new HistogramFunctionInst();
            inst.accept(
                    MeterEntity.newService("service-test", Layer.GENERAL),
                    new BucketedValues(
                            BUCKETS, new long[]{
                            0,
                            4,
                            10,
                            10
                    })
            );

            inst.accept(
                    MeterEntity.newService("service-test", Layer.GENERAL),
                    new BucketedValues(
                            BUCKETS_2ND, new long[]{
                            1,
                            2,
                            3,
                            4
                    })
            );
        });
    }