@Test
  public void testIsPrefix() throws Exception {
    assertTrue(Util.isPrefix(new byte[] {1, 2, 3}, new byte[] {1, 2, 3, 4, 5}));
    assertTrue(Util.isPrefix(new byte[] {}, new byte[] {1, 2, 3, 4, 5}));
    assertTrue(Util.isPrefix(new byte[] {}, new byte[] {}));
    assertTrue(Util.isPrefix(new byte[] {5, 7, 9}, new byte[] {5, 7, 9}));

    assertFalse(Util.isPrefix(new byte[] {5, 7, 9, 10}, new byte[] {5, 7, 9}));
    assertFalse(Util.isPrefix(new byte[] {5, 7, 10}, new byte[] {5, 7, 9}));
    assertFalse(Util.isPrefix(new byte[] {1}, new byte[] {}));
  }
Tests for Tink internal Util class.
java_src/src/test/java/com/google/crypto/tink/internal/UtilTest.java