public void testUpdate() {
int size = 100000;
Random r = new Random();
float[] floats = new float[size];
Int2FloatMap map = new Int2FloatOpenHashMapWritable();
for (int i = 0; i < size; i++) {
float k = r.nextFloat() * size;
map.put(i, k);
floats[i] = k;
}
assertEquals(size, map.size());
for (int i = 0; i < size; i++) {
map.put(i, floats[i] + 1.0f);
}
assertEquals(size, map.size());
for (int i = 0; i < size; i++) {
assertEquals(floats[i] + 1.0f, map.get(i), 10e-6);
assertTrue(map.containsKey(i));
}
}