public static void assertByteArrayEquals(String txt, byte[] expected, byte[] actual)
      throws Exception {
    assertEquals(txt + " arrays not of the same length", expected.length, actual.length);
    for (int i = 0; i < expected.length; i++) {
      if (expected[i] != actual[i]) {
        assertEquals(txt + " difference at position:" + i, expected[i], actual[i]);
      }
    }
  }
Replacement for org.junit.Assert.assertEquals, since org.junit.Assert.assertEquals is quite
slow.
java_src/src/main/java/com/google/crypto/tink/testing/TestUtil.java