public static boolean isSorted(Collection<byte[]> arrays) {
    if (!CollectionUtils.isEmpty(arrays)) {
      byte[] previous = new byte[0];
      for (byte[] array : arrays) {
        if (Bytes.compareTo(previous, array) > 0) {
          return false;
        }
        previous = array;
      }
    }
    return true;
  }
Treat the byte[] as an unsigned series of bytes, most significant bits first. Start by adding 1
to the rightmost bit/byte and carry over all overflows to the more significant bits/bytes.
@param input The byte[] to increment.
@return The incremented copy of "in". May be same length or 1 byte longer.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java