public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testNameIsReplacedOnMatch() throws Exception {
        new JmxCollector(
                        "\n---\nrules:\n- pattern: `^hadoop<service=DataNode, name=DataNodeActivity-ams-hdd001-50010><>replaceBlockOpMinTime:`\n  name: foo"
                                .replace('`', '"'))
                .register(prometheusRegistry);
        assertEquals(200, getSampleValue("foo", new String[] {}, new String[] {}), .001);
    }