@Override
    public ReturnCode filterCell(Cell v) throws IOException {
      if (cellCount >= 6) {
        cellCount++;
        return ReturnCode.SKIP;
      }
      cellCount++;
      return ReturnCode.INCLUDE;
    }
Test from client side for scan while the region is reopened on the same region server.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java