public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testExcludeObjectNames() throws Exception {
        JmxCollector jc =
                new JmxCollector(
                                "\n---\nincludeObjectNames:\n- java.lang:*\n- org.apache.cassandra.concurrent:*\nexcludeObjectNames:\n- org.apache.cassandra.concurrent:*"
                                        .replace('`', '"'))
                        .register(prometheusRegistry);

        // Test what should and shouldn't be present.
        assertNotNull(
                getSampleValue(
                        "java_lang_OperatingSystem_ProcessCpuTime",
                        new String[] {},
                        new String[] {}));

        assertNull(
                getSampleValue(
                        "org_apache_cassandra_concurrent_CONSISTENCY_MANAGER_ActiveCount",
                        new String[] {},
                        new String[] {}));
        assertNull(
                getSampleValue(
                        "org_apache_cassandra_metrics_Compaction_Value",
                        new String[] {"name"},
                        new String[] {"CompletedTasks"}));
        assertNull(
                getSampleValue(
                        "hadoop_DataNode_replaceBlockOpMinTime",
                        new String[] {"name"},
                        new String[] {"DataNodeActivity-ams-hdd001-50010"}));
    }