@Test
  public void testRegionOnCoprocessorsChange() throws IOException {
    byte[] cf1 = Bytes.toBytes("CF1");
    byte[][] families = { cf1 };

    Configuration conf = new Configuration(CONF);
    region = initHRegion(tableName, method, conf, families);
    assertNull(region.getCoprocessorHost());

    // set and verify the system coprocessors for region and user region
    Configuration newConf = new Configuration(conf);
    newConf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MetaTableMetrics.class.getName());
    newConf.set(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY,
      NoOpRegionCoprocessor.class.getName());
    // trigger configuration change
    region.onConfigurationChange(newConf);
    assertTrue(region.getCoprocessorHost() != null);
    Set<String> coprocessors = region.getCoprocessorHost().getCoprocessors();
    assertTrue(coprocessors.size() == 2);
    assertTrue(region.getCoprocessorHost().getCoprocessors()
      .contains(MetaTableMetrics.class.getSimpleName()));
    assertTrue(region.getCoprocessorHost().getCoprocessors()
      .contains(NoOpRegionCoprocessor.class.getSimpleName()));

    // remove region coprocessor and keep only user region coprocessor
    newConf.unset(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY);
    region.onConfigurationChange(newConf);
    assertTrue(region.getCoprocessorHost() != null);
    coprocessors = region.getCoprocessorHost().getCoprocessors();
    assertTrue(coprocessors.size() == 1);
    assertTrue(region.getCoprocessorHost().getCoprocessors()
      .contains(NoOpRegionCoprocessor.class.getSimpleName()));
  }
HStoreForTesting is merely the same as HStore, the difference is in the doCompaction method of
HStoreForTesting there is a checkpoint "hbase.hstore.compaction.complete" which doesn't let
hstore compaction complete. In the former edition, this config is set in HStore class inside
compact method, though this is just for testing, otherwise it doesn't do any help. In
HBASE-8518, we try to get rid of all "hbase.hstore.compaction.complete" config (except for
testing code).
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java