void apply(Metrics.MetricsBuilder metricsBuilder) {
    metricsBuilder.topicBytesInPerSec(bytesInFifteenMinuteRate);
    metricsBuilder.topicBytesOutPerSec(bytesOutFifteenMinuteRate);
    metricsBuilder.brokerBytesInPerSec(brokerBytesInFifteenMinuteRate);
    metricsBuilder.brokerBytesOutPerSec(brokerBytesOutFifteenMinuteRate);
  }
@Test
  void appliesInnerStateToMetricsBuilder() {
    //filling per topic io rates
    wellKnownMetrics.bytesInFifteenMinuteRate.put("topic", new BigDecimal(1));
    wellKnownMetrics.bytesOutFifteenMinuteRate.put("topic", new BigDecimal(2));

    //filling per broker io rates
    wellKnownMetrics.brokerBytesInFifteenMinuteRate.put(1, new BigDecimal(1));
    wellKnownMetrics.brokerBytesOutFifteenMinuteRate.put(1, new BigDecimal(2));
    wellKnownMetrics.brokerBytesInFifteenMinuteRate.put(2, new BigDecimal(10));
    wellKnownMetrics.brokerBytesOutFifteenMinuteRate.put(2, new BigDecimal(20));

    Metrics.MetricsBuilder builder = Metrics.builder();
    wellKnownMetrics.apply(builder);
    var metrics = builder.build();

    // checking per topic io rates
    assertThat(metrics.getTopicBytesInPerSec()).containsExactlyEntriesOf(wellKnownMetrics.bytesInFifteenMinuteRate);
    assertThat(metrics.getTopicBytesOutPerSec()).containsExactlyEntriesOf(wellKnownMetrics.bytesOutFifteenMinuteRate);

    // checking per broker io rates
    assertThat(metrics.getBrokerBytesInPerSec()).containsExactlyInAnyOrderEntriesOf(
        Map.of(1, new BigDecimal(1), 2, new BigDecimal(10)));
    assertThat(metrics.getBrokerBytesOutPerSec()).containsExactlyInAnyOrderEntriesOf(
        Map.of(1, new BigDecimal(2), 2, new BigDecimal(20)));
  }