@Override
    public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
      if (b1 == b2 && s1 == s2 && l1 == l2) {
        return 0;
      }
      if (l1 == 0) {
        return l2; // 0 or positive
      }
      if (l2 == 0) {
        return -1;
      }
      return super.compare(b1, s1, l1, b2, s2, l2);
    }
A {@link ByteArrayComparator} that treats the empty array as the largest value. This is useful
for comparing row end keys for regions.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java