public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
/** * Test that the full list iterator contract is correct. */ public void testFullMapIterator() { if (supportsFullIterator() == false) { return; } MapIterator it = makeFullMapIterator(); Map map = getMap(); assertEquals(true, it.hasNext()); assertEquals(true, it.hasNext()); Set set = new HashSet(); while (it.hasNext()) { // getKey Object key = it.next(); assertSame("it.next() should equals getKey()", key, it.getKey()); assertTrue("Key must be in map", map.containsKey(key)); assertTrue("Key must be unique", set.add(key)); // getValue Object value = it.getValue(); if (isGetStructuralModify() == false) { assertSame("Value must be mapped to key", map.get(key), value); } assertTrue("Value must be in map", map.containsValue(value)); verify(); } }
public void testMapIteratorRemoveGetKey() { if (supportsRemove() == false) { return; } MapIterator it = makeFullMapIterator(); Map map = getMap(); Map confirmed = getConfirmedMap(); assertEquals(true, it.hasNext()); Object key = it.next(); it.remove(); confirmed.remove(key); verify(); try { it.getKey(); fail(); } catch (IllegalStateException ex) {} verify(); }
assertSame("Key must not change after setValue", key, it.getKey()); assertSame("Value must be changed after setValue", newValue, it.getValue()); assertSame("setValue must return old value", value, old); assertSame("Key must not change after setValue", key, it.getKey()); assertSame("Value must be changed after setValue", newValue, it.getValue()); verify(); assertSame("Key must not change after setValue", key, it.getKey()); assertSame("Value must be changed after setValue", newValue2, it.getValue()); verify();
assertSame(key1, it.getKey()); assertSame(newValue1, it.getValue()); assertEquals(true, bidi.containsKey(key1)); assertSame(key1, it.getKey()); assertSame(newValue1, it.getValue()); assertEquals(true, bidi.containsKey(key1)); it.setValue(newValue2); confirmed.put(key2, newValue2); assertSame(key2, it.getKey()); assertSame(newValue2, it.getValue()); assertEquals(true, bidi.containsKey(key2)); AbstractTestBidiMap.this.confirmed.remove(key1); assertEquals(newValue1, it.getValue()); assertEquals(true, bidi.containsKey(it.getKey())); assertEquals(true, bidi.containsValue(newValue1)); assertEquals(newValue1, bidi.get(it.getKey())); assertEquals(false, bidi.containsKey(key1)); assertEquals(false, bidi.containsValue(newValue2));
it.getKey(); fail(); } catch (IllegalStateException ex) {}
} catch (IllegalStateException ex) {} try { IteratorUtils.EMPTY_MAP_ITERATOR.getKey(); fail(); } catch (IllegalStateException ex) {}
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }
public Object getKey() { return iterator.getKey(); }