225226227228229230231232233234235
m.increment(1, 1); assertEquals(1, m.get(1)); m.increment(1, 1); m.increment(2, 0); m.increment(3, -1); assertEquals(2, m.get(1)); assertEquals(0, m.get(2)); assertEquals(-1, m.get(3));
226227228229230231232233234235236
m.increment(1, 1); assertEquals(1, m.get(1)); m.increment(1, 1); m.increment(2, 0); m.increment(3, -1); assertEquals(2, m.get(1)); assertEquals(0, m.get(2)); assertEquals(-1, m.get(3)); }
221222223224225226227228229230231
@Test public void testIncrement() { HMapIS m = new HMapIS(); assertEquals(0, m.get(1)); m.increment(1, (short) 1); assertEquals(1, m.get(1)); m.increment(1, (short) 1); m.increment(2, (short) 0); m.increment(3, (short) -1);
224225226227228229230231232233234
assertEquals(0, m.get(1)); m.increment(1, (short) 1); assertEquals(1, m.get(1)); m.increment(1, (short) 1); m.increment(2, (short) 0); m.increment(3, (short) -1); assertEquals(2, m.get(1)); assertEquals(0, m.get(2));
m.increment(1, (short) 1); assertEquals(1, m.get(1)); m.increment(1, (short) 1); m.increment(2, (short) 0); m.increment(3, (short) -1); assertEquals(2, m.get(1)); assertEquals(0, m.get(2)); assertEquals(-1, m.get(3));
m.increment(1, (short) 1); assertEquals(1, m.get(1)); m.increment(1, (short) 1); m.increment(2, (short) 0); m.increment(3, (short) -1); assertEquals(2, m.get(1)); assertEquals(0, m.get(2)); assertEquals(-1, m.get(3)); }