assertEquals(IntToFloatMap.GROUND, value, Float.MAX_VALUE);
}
@Test
public void test0() {
IntToFloatMap map = new IntToFloatMap();
assertGround(map.get(0));
for (int i = 0; i < 100; ++i) {
int value = 100 + i;
assertFalse(map.containsValue(value));
map.put(i, value);
assertTrue(map.containsValue(value));
assertNotNull(map.get(i));
}
assertEquals(100, map.size());
for (int i = 0; i < 100; ++i) {
assertTrue(map.containsKey(i));
assertEquals(100 + i, map.get(i), Float.MAX_VALUE);
}
for (int i = 10; i < 90; ++i) {
map.remove(i);
assertGround(map.get(i));
}
assertEquals(20, map.size());
for (int i = 0; i < 100; ++i) {
assertEquals(map.containsKey(i), !(i >= 10 && i < 90));
}
for (int i = 5; i < 85; ++i) {
map.put(i, Integer.valueOf(5 + i));
}
assertEquals(95, map.size());
for (int i = 0; i < 100; ++i) {
assertEquals(map.containsKey(i), !(i >= 85 && i < 90));
}
for (int i = 0; i < 5; ++i) {
assertEquals(map.get(i), (100 + i), Float.MAX_VALUE);
}
for (int i = 5; i < 85; ++i) {
assertEquals(map.get(i), (5 + i), Float.MAX_VALUE);
}
for (int i = 90; i < 100; ++i) {
assertEquals(map.get(i), (100 + i), Float.MAX_VALUE);
}
}