@Override
    public <T extends Metric> T register(String name, T metric) throws IllegalArgumentException {
        if (metric == null) {
            throw new NullPointerException("metric == null");
        }
        return metric;
    }
@Test
    public void registerNullMetric() {
        MetricRegistry registry = new NoopMetricRegistry();
        assertThatNullPointerException()
                .isThrownBy(() -> registry.register("any_name", null))
                .withMessage("metric == null");
    }