public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testCompositeData() throws Exception {
        JmxCollector jc =
                new JmxCollector(
                                "\n---\nrules:\n- pattern: `io.prometheus.jmx.test<name=PerformanceMetricsMBean><PerformanceMetrics>.*`\n  attrNameSnakeCase: true"
                                        .replace('`', '"'))
                        .register(prometheusRegistry);

        Double value =
                getSampleValue(
                        "io_prometheus_jmx_test_PerformanceMetricsMBean_PerformanceMetrics_active_sessions",
                        new String[] {},
                        new String[] {});

        assertEquals(Double.valueOf(2), value);

        value =
                getSampleValue(
                        "io_prometheus_jmx_test_PerformanceMetricsMBean_PerformanceMetrics_bootstraps",
                        new String[] {},
                        new String[] {});

        assertEquals(Double.valueOf(4), value);

        value =
                getSampleValue(
                        "io_prometheus_jmx_test_PerformanceMetricsMBean_PerformanceMetrics_bootstraps_deferred",
                        new String[] {},
                        new String[] {});

        assertEquals(Double.valueOf(6), value);
    }