private void generateRows(Table ht, byte[] family, byte[] qf) throws IOException {
    for (int a = 1; a < 2; ++a) {
      for (int b = 9; b < 22; ++b) {
        for (int c = 89; c < 102; ++c) {
          for (int d = 1; d < 2; ++d) {
            byte[] key = new byte[16];
            Bytes.putInt(key, 0, a);
            Bytes.putInt(key, 4, b);
            Bytes.putInt(key, 8, c);
            Bytes.putInt(key, 12, d);
            Put row = new Put(key);
            if (c % 2 == 0) {
              row.addColumn(family, qf, Bytes.toBytes("abc"));
              if (LOG.isInfoEnabled()) {
                LOG.info("added row: {} with value 'abc'", Arrays.toString(Hex.encodeHex(key)));
              }
            } else {
              row.addColumn(family, qf, Bytes.toBytes("xyz"));
              if (LOG.isInfoEnabled()) {
                LOG.info("added row: {} with value 'xyz'", Arrays.toString(Hex.encodeHex(key)));
              }
            }
          }
        }
      }
    }
    TEST_UTIL.flush();
  }
Since we are trying to emulate SQL: SELECT * from table where a = 1 and b > 10 and b < 20 and c
> 90 and c < 100 and d = 1 We are generating rows with: a = 1, b >=9 and b < 22, c >= 89 and c
< 102, and d = 1 At the end the table will look something like this: ------------ a| b| c|d|
------------ 1| 9| 89|1|family:qf|xyz| ----------- 1| 9| 90|1|family:qf|abc| ----------- 1| 9|
91|1|family:qf|xyz| ------------------------- . ------------------------- .
------------------------- 1|21|101|1|family:qf|xyz|
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFiltersWithBinaryComponentComparator.java