@Test
public void registerNullMetric() {

    MetricRegistry registry = new MetricRegistry();   
    try {
        registry.register("any_name", null);
        Assert.fail("NullPointerException must be thrown !!!");
    } catch (NullPointerException e) {
        Assert.assertEquals("metric == null", e.getMessage());
    }
}