@Test
  public void isDisabledByDefault() throws Exception {
    System.clearProperty("net.spy.metrics.enable");
    System.clearProperty("net.spy.metrics.type");

    ConnectionFactory cf = new DefaultConnectionFactory();
    assertEquals(MetricType.OFF, cf.enableMetrics());
    assertTrue(cf.getMetricCollector() instanceof NoopMetricCollector);

    cf = new BinaryConnectionFactory();
    assertEquals(MetricType.OFF, cf.enableMetrics());
    assertTrue(cf.getMetricCollector() instanceof NoopMetricCollector);
  }
Tests the initialization and measurement of Metrics.
src/test/java/net/spy/memcached/MetricsTest.java