RandomUtils { public static int hashFloat(float value) { return Float.floatToIntBits(value); } private  RandomUtils(); static void useTestSeed(); static RandomWrapper getRandom(); static Random getRandom(long seed); static int hashDouble(double value); static int hashFloat(float value); static int nextTwinPrime(int n); static final int MAX_INT_SMALLER_TWIN_PRIME; }
@Test public void testHashFloat() { assertEquals(new Float(0.0f).hashCode(), RandomUtils.hashFloat(0.0f)); assertEquals(new Float(1.0f).hashCode(), RandomUtils.hashFloat(1.0f)); assertEquals(new Float(Float.POSITIVE_INFINITY).hashCode(), RandomUtils.hashFloat(Float.POSITIVE_INFINITY)); assertEquals(new Float(Float.NaN).hashCode(), RandomUtils.hashFloat(Float.NaN)); }