code: public static int getCodePointBefore(Slice utf8, int position)
      {
          byte unsignedByte = utf8.getByte(position - 1);
          if (!isContinuationByte(unsignedByte)) {
              return unsignedByte & 0xFF;
          }
          if (!isContinuationByte(utf8.getByte(position - 2))) {
              return getCodePointAt(utf8, position - 2);
          }
          if (!isContinuationByte(utf8.getByte(position - 3))) {
              return getCodePointAt(utf8, position - 3);
          }
          if (!isContinuationByte(utf8.getByte(position - 4))) {
              return getCodePointAt(utf8, position - 4);
          }
  
          // Per RFC3629, UTF-8 is limited to 4 bytes, so more bytes are illegal
          throw new InvalidUtf8Exception("UTF-8 is not well formed");
      }
docs: Gets the UTF-8 encoded code point before the {@code position}.
  <p>
  Note: This method does not explicitly check for valid UTF-8, and may
  return incorrect results or throw an exception for invalid UTF-8.