private void setRowFilters(FilterList filterList) {
    // offset for b as it is second component of "a+b+c+d"
    // 'a' is at offset 0
    int bOffset = 4;
    byte[] b10 = Bytes.toBytes(10); // tests b > 10
    Filter b10Filter =
      new RowFilter(CompareOperator.GREATER, new BinaryComponentComparator(b10, bOffset));
    filterList.addFilter(b10Filter);

    byte[] b20 = Bytes.toBytes(20); // tests b < 20
    Filter b20Filter =
      new RowFilter(CompareOperator.LESS, new BinaryComponentComparator(b20, bOffset));
    filterList.addFilter(b20Filter);

    // offset for c as it is third component of "a+b+c+d"
    int cOffset = 8;
    byte[] c90 = Bytes.toBytes(90); // tests c > 90
    Filter c90Filter =
      new RowFilter(CompareOperator.GREATER, new BinaryComponentComparator(c90, cOffset));
    filterList.addFilter(c90Filter);

    byte[] c100 = Bytes.toBytes(100); // tests c < 100
    Filter c100Filter =
      new RowFilter(CompareOperator.LESS, new BinaryComponentComparator(c100, cOffset));
    filterList.addFilter(c100Filter);

    // offset for d as it is fourth component of "a+b+c+d"
    int dOffset = 12;
    byte[] d1 = Bytes.toBytes(1); // tests d == 1
    Filter dFilter =
      new RowFilter(CompareOperator.EQUAL, new BinaryComponentComparator(d1, dOffset));

    filterList.addFilter(dFilter);

  }
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