@Override
    public CompletableFuture<MeterStoreResult> addOrUpdateMeter(Meter meter) {
        checkArgument(validIndex(meter), "Meter index is not valid");
        CompletableFuture<MeterStoreResult> future = new CompletableFuture<>();
        MeterKey key = MeterKey.key(meter.deviceId(), meter.meterCellId());
        MeterData data = new MeterData(meter, null);
        futures.put(key, future);
        try {
            meters.compute(key, (k, v) -> data);
        } catch (StorageException e) {
            log.error("{} thrown a storage exception: {}", e.getStackTrace()[0].getMethodName(),
                    e.getMessage(), e);
            futures.remove(key);
            future.completeExceptionally(e);
        }
        return future;
    }
@Test(expected = IllegalArgumentException.class)
    public void testInvalidCellId() {
        initMeterStore(true);

        // MF defines an end index equals to 10
        Meter meterBad = DefaultMeter.builder()
                .forDevice(did3)
                .fromApp(APP_ID)
                .withCellId(invalidCid)
                .withUnit(Meter.Unit.KB_PER_SEC)
                .withBands(Collections.singletonList(b1))
                .build();
        ((DefaultMeter) meterBad).setState(MeterState.PENDING_ADD);
        meterStore.addOrUpdateMeter(meterBad);
    }