@SuppressWarnings("unchecked")
@Test
public void typical() throws Exception {

  PartitionReplica replica = new PartitionReplica(1, true, false, 3L, 2L, 4L, 5L, 1L);
  List<PartitionReplica> replicas = singletonList(replica);
  Topic topic = new Topic("topicName", Duration.ofMillis(2L), replicas);
  LogDir logDir = new LogDir("path", 1L, 3L, singletonList(topic));
  List<LogDir> logDirs = singletonList(logDir);
  Broker broker = new Broker(0, "rack", logDirs);
  underTest.update(broker);
  Matcher<Iterable<? extends Tag>> diskTags = containsInAnyOrder(tag("broker", "0"), tag("logdir", "path"),
      tag("rack", "rack"));
  Matcher<Iterable<? extends Tag>> replicaTags = containsInAnyOrder(tag("broker", "0"), tag("logdir", "path"),
      tag("rack", "rack"), tag("topic", "topicName"), tag("partition", "1"), tag("leader", "true"),
      tag("inSync", "false"));
  assertMeter(registry.get("weighbridge_disk_free").meter(), diskTags, 1.0);
  assertMeter(registry.get("weighbridge_disk_total").meter(), diskTags, 3.0);
  assertMeter(registry.get("weighbridge_disk_used").meter(), diskTags, 2.0);
  assertMeter(registry.get("weighbridge_size_on_disk").meter(), replicaTags, 3.0);
  assertMeter(registry.get("weighbridge_log_size").meter(), replicaTags, 2.0);
  assertMeter(registry.get("weighbridge_beginning_offset").meter(), replicaTags, 4.0);
  assertMeter(registry.get("weighbridge_end_offset").meter(), replicaTags, 5.0);
  assertMeter(registry.get("weighbridge_record_count").meter(), replicaTags, 1.0);
}