public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testEnumValue() throws Exception {
        JmxCollector jc =
                new JmxCollector(
                                "\n---\nrules:\n- pattern: `org.bean.enum<type=StateMetrics.*>State: RUNNING`\n  name: bean_running\n  value: 1"
                                        .replace('`', '"'))
                        .register(prometheusRegistry);
        assertEquals(1.0, getSampleValue("bean_running", new String[] {}, new String[] {}), .001);
    }