@Test public void testRemove() { Iterator<String> I = arr.iterator(); removeOdd(I); I = l.iterator(); removeOdd(I); assertEquals(arr.toString(), l.toString()); assertEquals(arr.size(), l.size()); assertEquals("<12, <>>", "" + l.getTail()); }
public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; }
SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } }
SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList();  SinglyLinkedList(Iterable<E> c); }
SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList();  SinglyLinkedList(Iterable<E> c); boolean add(E e); boolean addAll(Iterable<E> c); boolean contains(Object o); @Override boolean equals(Object o); @Override int hashCode(); boolean isEmpty(); boolean remove(Object o); int size(); void replace(Iterator<E> I, Iterator<E> J, SinglyLinkedList<E> replacement); void nonDestructiveReplace(Iterator<E> I, Iterator<E> J, Iterable<E> replacement); void printRange(Iterator<E> I, Iterator<E> J); @Override String toString(); @Override Iterator<E> iterator(); Iterator<E> iterator(Iterator<E> I); Node getHead(); Node getTail(); }
SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList();  SinglyLinkedList(Iterable<E> c); boolean add(E e); boolean addAll(Iterable<E> c); boolean contains(Object o); @Override boolean equals(Object o); @Override int hashCode(); boolean isEmpty(); boolean remove(Object o); int size(); void replace(Iterator<E> I, Iterator<E> J, SinglyLinkedList<E> replacement); void nonDestructiveReplace(Iterator<E> I, Iterator<E> J, Iterable<E> replacement); void printRange(Iterator<E> I, Iterator<E> J); @Override String toString(); @Override Iterator<E> iterator(); Iterator<E> iterator(Iterator<E> I); Node getHead(); Node getTail();  }