@Override
  public void init() {
    // Make sure that the metrics system doesn't throw an exception when
    // registering a source with the same name
    DefaultMetricsSystem.setMiniClusterMode(true);
  }
A helper class that will allow tests to get into hadoop2's metrics2 values.
hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelperImpl.java