@Before
  public void setUp() {
    wrapper = new MetricsRegionServerWrapperStub();
    rsm = new MetricsRegionServer(wrapper, new Configuration(false), null);
    serverSource = rsm.getMetricsSource();
  }
Unit test version of rs metrics tests.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServer.java