code: public static int compareUtf16BE(Slice utf8Left, Slice utf8Right)
      {
          int leftLength = utf8Left.length();
          int rightLength = utf8Right.length();
  
          int offset = 0;
          while (offset < leftLength) {
              // if there are no more right code points, right is less
              if (offset >= rightLength) {
                  return 1; // left.compare(right) > 0
              }
  
              int leftCodePoint = tryGetCodePointAt(utf8Left, offset);
              if (leftCodePoint < 0) {
                  throw new InvalidUtf8Exception("Invalid UTF-8 sequence in utf8Left at " + offset);
              }
  
              int rightCodePoint = tryGetCodePointAt(utf8Right, offset);
              if (rightCodePoint < 0) {
                  throw new InvalidUtf8Exception("Invalid UTF-8 sequence in utf8Right at " + offset);
              }
  
              int result = compareUtf16BE(leftCodePoint, rightCodePoint);
              if (result != 0) {
                  return result;
              }
  
              // the code points are the same and non-canonical sequences are not allowed,
              // so we advance a single offset through both sequences
              offset += lengthOfCodePoint(leftCodePoint);
          }
  
          // there are no more left code points, so if there are more right code points,
          // left is less
          if (offset < rightLength) {
              return -1; // left.compare(right) < 0
          }
  
          return 0;
      }
docs: Compares to UTF-8 sequences using UTF-16 big endian semantics.  This is
  equivalent to the {@link java.lang.String#compareTo(Object)}.
  {@code java.lang.String}.
  
  @throws InvalidUtf8Exception if the UTF-8 are invalid