// Path: metrics/src/main/java/com/google/monitoring/metrics/MetricSchema.java
// public enum Kind {
//   CUMULATIVE,
//   GAUGE,
// }


import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.mock;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.monitoring.metrics.MetricSchema.Kind;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

    AbstractMetric<?> metric = mock(AbstractMetric.class);
    MetricRegistryImpl.getDefault().registerMetric("/test/metric", metric);

    assertThat(MetricRegistryImpl.getDefault().getRegisteredMetrics()).containsExactly(metric);

    MetricRegistryImpl.getDefault().unregisterMetric("/test/metric");

    assertThat(MetricRegistryImpl.getDefault().getRegisteredMetrics()).isEmpty();
  }

  @Test
  public void testNewGauge_createsGauge() {
    Metric<?> testGauge =
        MetricRegistryImpl.getDefault()
            .newGauge(
                "/test_metric",
                "test_description",
                "test_valuedisplayname",
                ImmutableSet.of(label),
                () -> ImmutableMap.of(ImmutableList.of("foo"), 1L),
                Long.class);

    assertThat(testGauge.getValueClass()).isSameInstanceAs(Long.class);
    assertThat(testGauge.getMetricSchema())
        .isEqualTo(
            MetricSchema.create(
                "/test_metric",
                "test_description",
                "test_valuedisplayname",
// Path: metrics/src/main/java/com/google/monitoring/metrics/MetricSchema.java
// public enum Kind {
//   CUMULATIVE,
//   GAUGE,
// }


// Path: metrics/src/test/java/com/google/monitoring/metrics/MetricRegistryImplTest.java
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.mock;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.monitoring.metrics.MetricSchema.Kind;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;


    AbstractMetric<?> metric = mock(AbstractMetric.class);
    MetricRegistryImpl.getDefault().registerMetric("/test/metric", metric);

    assertThat(MetricRegistryImpl.getDefault().getRegisteredMetrics()).containsExactly(metric);

    MetricRegistryImpl.getDefault().unregisterMetric("/test/metric");

    assertThat(MetricRegistryImpl.getDefault().getRegisteredMetrics()).isEmpty();
  }

  @Test
  public void testNewGauge_createsGauge() {
    Metric<?> testGauge =
        MetricRegistryImpl.getDefault()
            .newGauge(
                "/test_metric",
                "test_description",
                "test_valuedisplayname",
                ImmutableSet.of(label),
                () -> ImmutableMap.of(ImmutableList.of("foo"), 1L),
                Long.class);

    assertThat(testGauge.getValueClass()).isSameInstanceAs(Long.class);
    assertThat(testGauge.getMetricSchema())
        .isEqualTo(
            MetricSchema.create(
                "/test_metric",
                "test_description",
                "test_valuedisplayname",
                Kind.GAUGE,