Lookup3Hash extends Hash { @Override public int hash(byte[] bytes, int length, int seed) { throw new UnsupportedOperationException("Not supported yet."); }  @SuppressWarnings("fallthrough") static int lookup3(int[] k, int offset, int length, int initval); static int lookup3ycs(int[] k, int offset, int length, int initval); static int lookup3ycs(CharSequence s, int start, int end, int initval); static long lookup3ycs64(CharSequence s, int start, int end, long initval); static long lookup3ycs64(CharSequence s); @Override int hash(byte[] bytes, int length, int seed); @Override long hash64(byte[] bytes, int length, int seed); @Override int hash(Object o); @Override long hash64(Object o);  }
@Test public void testHash() { Random r = new Random(0); int[] utf32 = new int[20]; tstEquiv(utf32, 0); utf32[0] = 0x10000; tstEquiv(utf32, 1); utf32[0] = 0x8000; tstEquiv(utf32, 1); utf32[0] = Character.MAX_CODE_POINT; tstEquiv(utf32, 1); for (int iter = 0; iter < 10000; iter++) { int len = r.nextInt(utf32.length + 1); for (int i = 0; i < len; i++) { int codePoint; do { codePoint = r.nextInt(Character.MAX_CODE_POINT + 1); } while ((codePoint & 0xF800) == 0xD800); utf32[i] = codePoint; } tstEquiv(utf32, len); } }