@Test
  public void testSmallScan() throws Exception {
    // Test Initialization.
    final TableName tableName = name.getTableName();
    try (Table table = TEST_UTIL.createTable(tableName, FAMILY)) {

      // Insert one row each region
      int insertNum = 10;
      for (int i = 0; i < 10; i++) {
        Put put = new Put(Bytes.toBytes("row" + String.format("%03d", i)));
        put.addColumn(FAMILY, QUALIFIER, VALUE);
        table.put(put);
      }

      // normal scan
      try (ResultScanner scanner = table.getScanner(new Scan())) {
        int count = 0;
        for (Result r : scanner) {
          assertFalse(r.isEmpty());
          count++;
        }
        assertEquals(insertNum, count);
      }

      // small scan
      Scan scan = new Scan().withStartRow(HConstants.EMPTY_START_ROW)
        .withStopRow(HConstants.EMPTY_END_ROW, true);
      scan.setReadType(ReadType.PREAD);
      scan.setCaching(2);
      try (ResultScanner scanner = table.getScanner(scan)) {
        int count = 0;
        for (Result r : scanner) {
          assertFalse(r.isEmpty());
          count++;
        }
        assertEquals(insertNum, count);
      }
    }
  }
Tests getRegionsInRange by creating some regions over which a range of keys spans; then
changing the key range.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java