Code example for ListIterator

Methods: nextremoveset

0
    multimap.put("foo", 3); 
    multimap.put("foo", 5); 
    List<Integer> list = multimap.get("foo"); 
    ListIterator<Integer> iterator = list.listIterator(); 
 
    assertEquals(1, iterator.next().intValue()); 
    iterator.set(2); 
    ASSERT.that(multimap.get("foo")).hasContentsInOrder(2, 3, 5); 
 
    assertEquals(3, iterator.next().intValue()); 
    iterator.remove(); 
    ASSERT.that(multimap.get("foo")).hasContentsInOrder(2, 5); 
  } 
 
  /** 
   * Test calling toString() on the multimap, which does not have a 
   * deterministic iteration order for keys but does for values. 
   */ 
  public void testToString() { 
    String s = createSample().toString(); 
Stop searching for code, let great code find you!  Add Codota to your java IDE