@Override
  public boolean equals(@Nullable Object object) {
    if (object instanceof MetricsMap) {
      MetricsMap<?, ?> metricsMap = (MetricsMap<?, ?>) object;
      return Objects.equals(metrics, metricsMap.metrics);
    }

    return false;
  }
@Test
  public void testEquals() {
    MetricsMap<String, AtomicLong> metricsMap = new MetricsMap<>(unusedKey -> new AtomicLong());
    MetricsMap<String, AtomicLong> equal = new MetricsMap<>(unusedKey -> new AtomicLong());
    Assert.assertEquals(metricsMap, equal);
    Assert.assertEquals(metricsMap.hashCode(), equal.hashCode());
  }