private void unregister(KafkaMbean mbean) {
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        try {
            if (server.isRegistered(mbean.name()))
                server.unregisterMBean(mbean.name());
        } catch (JMException e) {
            throw new KafkaException("Error unregistering mbean", e);
        }
    }
@param metricName
@return standard JMX MBean name in the following format domainName:type=metricType,key1=val1,key2=val2
clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java