### Question:
MurmurHash { public static int hash32(final byte[] data, int start, int length, int seed) { final int m = 0x5bd1e995; final int r = 24; int h = seed ^ length; int length4 = length / 4; for (int i = 0; i < length4; i++) { final int i4 = i*4+start; int k = (data[i4] & 0xff) + ((data[i4 + 1] & 0xff) << 8) + ((data[i4 + 2] & 0xff) << 16) + ((data[i4 + 3] & 0xff) << 24); k *= m; k ^= k >>> r; k *= m; h *= m; h ^= k; } final int end = start + (length & ~3); switch (length % 4) { case 3: h ^= (data[end + 2] & 0xff) << 16; case 2: h ^= (data[end + 1] & 0xff) << 8; case 1: h ^= (data[end] & 0xff); h *= m; } h ^= h >>> 13; h *= m; h ^= h >>> 15; return h; }  static int hash32(final byte[] data, int start, int length, int seed); static int hash32(final byte[] data, int seed); static int hash32(final byte[] data, int start, int length); static int hash32(final byte[] data); static int hash32(final String text); static int hash32(final String text, int from, int length); static long hash64(final byte[] data, int seed); static long hash64(final byte[] data); static long hash64(final String text); static long hash64(final String text, int from, int length); static final int SEED32; static final int SEED64; }### Answer:
@Test public void testHash32ByteArrayIntInt() { for (int i = 0; i < input.length; i++) { int hash = MurmurHash.hash32(input[i], 0x71b4954d); if (hash != results32_seed[i]) { fail(String.format("Unexpected hash32 result for example %d: 0x%08x instead of 0x%08x", i, hash, results32_seed[i])); } } }
@Test public void testHash32ByteArrayInt() { for (int i = 0; i < input.length; i++) { int hash = MurmurHash.hash32(input[i]); if (hash != results32_standard[i]) { fail(String.format("Unexpected hash32 result for example %d: 0x%08x instead of 0x%08x", i, hash, results32_standard[i])); } } }
@Test public void testHash32String() { int hash = MurmurHash.hash32(text); assertTrue(hash == 0xb3bf597e); }
@Test public void testHash32StringIntInt() { int hash = MurmurHash.hash32(text, 2, text.length() - 4); assertTrue(hash == 0x4d666d90); }