@Test public void testDuplicates() { SpatialKeyHashtableOld store = new SpatialKeyHashtableOld().init(); assertEquals(0, store.put(12, 21, 123)); assertEquals(1, store.size()); assertEquals("location should already exist", 123, store.put(12, 21, 321)); assertEquals(1, store.size()); }
@Test public void testAdd() { SpatialKeyHashtableOld store = new SpatialKeyHashtableOld().init(); assertEquals(0, store.put(12, 21, 123)); assertEquals(123, store.get(12, 21)); assertEquals(1, store.size()); assertEquals(0, store.put(12, 21.0001f, 321)); assertEquals(321, store.get(12, 21.0001f)); assertEquals(2, store.size()); }