private static void rotate(byte[] string) {
    byte[] ref = Arrays.copyOf(string, string.length);
    for (int i = 0; i < string.length; i++) {
      string[i] =
          (byte)
              ((toUnsignedInt(string[i]) >> 1)
                  | ((1 & toUnsignedInt(ref[(i == 0 ? string.length : i) - 1])) << 7));
    }
  }
Manual implementation of Byte.toUnsignedByte. The Android JDK does not have this method.
java_src/src/main/java/com/google/crypto/tink/testing/TestUtil.java