public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void defaultExportTest() throws Exception {
        new JmxCollector("---").register(prometheusRegistry);

        // Test JVM bean.
        assertNotNull(
                getSampleValue(
                        "java_lang_OperatingSystem_ProcessCpuTime",
                        new String[] {},
                        new String[] {}));

        // Test Cassandra Bean.
        assertEquals(
                100,
                getSampleValue(
                        "org_apache_cassandra_concurrent_CONSISTENCY_MANAGER_ActiveCount",
                        new String[] {},
                        new String[] {}),
                .001);
        // Test Cassandra Metrics.
        assertEquals(
                .2,
                getSampleValue(
                        "org_apache_cassandra_metrics_Compaction_Value",
                        new String[] {"name"},
                        new String[] {"CompletedTasks"}),
                .001);

        // Test Hadoop Metrics.
        assertEquals(
                200,
                getSampleValue(
                        "hadoop_DataNode_replaceBlockOpMinTime",
                        new String[] {"name"},
                        new String[] {"DataNodeActivity-ams-hdd001-50010"}),
                .001);
    }