@Test
  public void toIntArrayAndBack_isEqual() {
    byte[] key = Random.randBytes(32);
    assertThat(ChaCha20Util.toByteArray(ChaCha20Util.toIntArray(key))).isEqualTo(key);
    byte[] nonce = Random.randBytes(24);
    assertThat(ChaCha20Util.toByteArray(ChaCha20Util.toIntArray(nonce))).isEqualTo(nonce);
    byte[] empty = new byte[0];
    assertThat(ChaCha20Util.toByteArray(ChaCha20Util.toIntArray(empty))).isEqualTo(empty);
  }
https://datatracker.ietf.org/doc/html/rfc7539#section-2.3.2
java_src/src/test/java/com/google/crypto/tink/aead/internal/ChaCha20UtilTest.java