public int metadataErrorCount() {
        return this.metadataErrorCount.get();
    }
@Test
    public void testMetadataErrorCount() {
        MetricsRegistry registry = new MetricsRegistry();
        try (ControllerMetadataMetrics metrics = new ControllerMetadataMetrics(Optional.of(registry))) {
            @SuppressWarnings("unchecked")
            Gauge<Integer> metadataErrorCount = (Gauge<Integer>) registry
                    .allMetrics()
                    .get(metricName("KafkaController", "MetadataErrorCount"));
            assertEquals(0, metadataErrorCount.value());
            metrics.incrementMetadataErrorCount();
            assertEquals(1, metadataErrorCount.value());
        } finally {
            registry.shutdown();
        }
    }