@Override
  public void assertGauge(String name, long expected, BaseSource source) {
    long found = getGaugeLong(name, source);
    assertEquals("Metrics Should be equal", (long) Long.valueOf(expected), found);
  }
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