@Test
  public void testLargerValue() throws Exception {
    init(UTIL.getConfiguration(), 200);
    byte[] dummyData = makeDummyData(300); // larger than mob threshold
    Table loader = new RegionAsTable(region);
    for (int i = 0; i < compactionThreshold; i++) {
      Put p = createPut(i, dummyData);
      loader.put(p);
      region.flush(true);
    }
    assertEquals("Before compaction: store files", compactionThreshold, countStoreFiles());
    assertEquals("Before compaction: mob file count", compactionThreshold, countMobFiles());
    assertEquals("Before compaction: rows", compactionThreshold, UTIL.countRows(region));
    assertEquals("Before compaction: mob rows", compactionThreshold, countMobRows());
    assertEquals("Before compaction: number of mob cells", compactionThreshold,
      countMobCellsInMetadata());
    // Change the threshold larger than the data size
    setMobThreshold(region, COLUMN_FAMILY, 500);
    region.initialize();

    List<HStore> stores = region.getStores();
    for (HStore store : stores) {
      // Force major compaction
      store.triggerMajorCompaction();
      Optional<CompactionContext> context = store.requestCompaction(HStore.PRIORITY_USER,
        CompactionLifeCycleTracker.DUMMY, User.getCurrent());
      if (!context.isPresent()) {
        continue;
      }
      region.compact(context.get(), store, NoLimitThroughputController.INSTANCE, User.getCurrent());
    }

    assertEquals("After compaction: store files", 1, countStoreFiles());
    assertEquals("After compaction: mob file count", compactionThreshold, countMobFiles());
    assertEquals("After compaction: referenced mob file count", 0, countReferencedMobFiles());
    assertEquals("After compaction: rows", compactionThreshold, UTIL.countRows(region));
    assertEquals("After compaction: mob rows", 0, countMobRows());
  }
During compaction, the mob threshold size is changed.
hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java