public Object setValue(Object obj) { return iterator.setValue(obj); }
public Object setValue(Object obj) { return iterator.setValue(obj); }
public void testMapIteratorSetRemoveSet() { if (supportsSetValue() == false || supportsRemove() == false) { return; } Object newValue = addSetValues()[0]; MapIterator it = makeFullMapIterator(); Map map = getMap(); Map confirmed = getConfirmedMap(); assertEquals(true, it.hasNext()); Object key = it.next(); it.setValue(newValue); it.remove(); confirmed.remove(key); verify(); try { it.setValue(newValue); fail(); } catch (IllegalStateException ex) {} verify(); }
it.setValue(newValue); fail(); } catch (UnsupportedOperationException ex) {} return; Object old = it.setValue(newValue); confirmed.put(key, newValue); assertSame("Key must not change after setValue", key, it.getKey()); verify(); it.setValue(newValue); // same value - should be OK confirmed.put(key, newValue); assertSame("Key must not change after setValue", key, it.getKey()); verify(); it.setValue(newValue2); // new value confirmed.put(key, newValue2); assertSame("Key must not change after setValue", key, it.getKey());
it.setValue(newValue1); fail(); } catch (UnsupportedOperationException ex) { it.setValue(newValue1); confirmed.put(key1, newValue1); assertSame(key1, it.getKey()); verify(); it.setValue(newValue1); // same value - should be OK confirmed.put(key1, newValue1); assertSame(key1, it.getKey()); it.setValue(newValue2); confirmed.put(key2, newValue2); assertSame(key2, it.getKey()); it.setValue(newValue1); // should remove key1 fail(); } catch (IllegalArgumentException ex) {
} catch (IllegalStateException ex) {} try { IteratorUtils.EMPTY_MAP_ITERATOR.setValue(null); fail(); } catch (IllegalStateException ex) {}
public Object setValue(Object obj) { return iterator.setValue(obj); }
public Object setValue(Object obj) { return iterator.setValue(obj); }
public Object setValue(Object obj) { return iterator.setValue(obj); }
public Object setValue(Object obj) { return iterator.setValue(obj); }
public Object setValue(Object obj) { return iterator.setValue(obj); }