@Test
  public void testZTestAutoCorrelationFailsOnAutoCorrelatedData() throws GeneralSecurityException {
    byte[] repeatedRandom = new byte[randomBytes.length * 3];
    for (int i = 0; i < 3; i++) {
      System.arraycopy(randomBytes, 0, repeatedRandom, i * randomBytes.length, randomBytes.length);
    }

    String msg =
        assertThrows(
                GeneralSecurityException.class,
                new ThrowingRunnable() {
                  @Override
                  public void run() throws Throwable {
                    TestUtil.ztestAutocorrelationUniformString(repeatedRandom);
                  }
                })
            .getMessage();
    assertThat(msg).contains("Z test for uniformly distributed variable out of bounds");
  }
Tests some of the more complex functions from TestUtil.
java_src/src/test/java/com/google/crypto/tink/testing/TestUtilTest.java