@Test
  public void testCoprocScannersExtendingShipperGetShipped() throws Exception {
    int shippedCountBefore = SHIPPED_COUNT.get();
    final TableName tableName = TableName.valueOf(name.getMethodName());
    // Create a table with block size as 1024
    final Table table = TEST_UTIL.createTable(tableName, new byte[][] { FAMILY }, 1, 1024,
      CompactionObserver.class.getName());
    TEST_UTIL.loadTable(table, FAMILY);
    TEST_UTIL.flush();
    try {
      // get the block cache and region
      RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName);
      String regionName = locator.getAllRegionLocations().get(0).getRegion().getEncodedName();
      HRegion region = TEST_UTIL.getRSForFirstRegionInTable(tableName).getRegion(regionName);
      // trigger a major compaction
      TEST_UTIL.compact(true);
      assertThat(SHIPPED_COUNT.get(), Matchers.greaterThan(shippedCountBefore));
    } finally {
      table.close();
    }
  }
Verifies that if a coproc returns an InternalScanner which implements Shipper, the shippped
method is appropriately called in Compactor.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionWithShippingCoprocessor.java