@Test
  public void testWhileMatchFilterWithFilterRowWithReverseScan() throws Exception {
    final int pageSize = 4;

    Scan s = new Scan();
    s.setReversed(true);
    WhileMatchFilter filter = new WhileMatchFilter(new PageFilter(pageSize));
    s.setFilter(filter);

    InternalScanner scanner = this.region.getScanner(s);
    int scannerCounter = 0;
    while (true) {
      boolean isMoreResults = scanner.next(new ArrayList<>());
      scannerCounter++;

      if (scannerCounter >= pageSize) {
        Assert.assertTrue("The WhileMatchFilter should now filter all remaining",
          filter.filterAllRemaining());
      }
      if (!isMoreResults) {
        break;
      }
    }
    scanner.close();
    Assert.assertEquals("The page filter returned more rows than expected", pageSize,
      scannerCounter);
  }
Test filters at the HRegion doorstep.
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java