StatsLog.logger.info(">>> testHashFunction");
int i = 0;
byte[] intByteArray = new byte[4];
ByteBuffer intByteBuffer = ByteBuffer.wrap(intByteArray);
HashFunctionInteger intHash = new HashFunctionInteger();
try {
i = 0;
intByteBuffer.clear();
intByteBuffer.putInt(i);
assertEquals(i, intHash.hash(intByteArray));
i = 1023;
intByteBuffer.clear();
intByteBuffer.putInt(i);
assertEquals(i, intHash.hash(intByteArray));
i = 65535;
intByteBuffer.clear();
intByteBuffer.putInt(i);
assertEquals(i, intHash.hash(intByteArray));
i = 131072;
intByteBuffer.clear();
intByteBuffer.putInt(i);
assertEquals(i, intHash.hash(intByteArray));
i = 262144;
intByteBuffer.clear();
intByteBuffer.putInt(i);
assertEquals(i, intHash.hash(intByteArray));
} catch (RuntimeException e) {
System.err.printf("hash(%d)=%d%n", i, intHash.hash(intByteArray));
throw e;
}
}