@Test public void isEmpty() { { SingleLinkedList<String> list = new SingleLinkedList<>(); assertTrue(list.isEmpty()); } { List<String> from = Arrays.asList("a"); SingleLinkedList<String> list = new SingleLinkedList<>(from); assertFalse(list.isEmpty()); } { List<String> from = Arrays.asList("a", "b", "c"); SingleLinkedList<String> list = new SingleLinkedList<>(from); assertFalse(list.isEmpty()); } }
public boolean isEmpty() { return head == null; }
SingleLinkedList implements Iterable<E>, Serializable { public boolean isEmpty() { return head == null; } }
SingleLinkedList implements Iterable<E>, Serializable { public boolean isEmpty() { return head == null; } SingleLinkedList();  SingleLinkedList(List<? extends E> list);  SingleLinkedList(Iterable<? extends E> iterable); private  SingleLinkedList(Node<E> head); }
SingleLinkedList implements Iterable<E>, Serializable { public boolean isEmpty() { return head == null; } SingleLinkedList();  SingleLinkedList(List<? extends E> list);  SingleLinkedList(Iterable<? extends E> iterable); private  SingleLinkedList(Node<E> head); boolean isEmpty(); int size(); SingleLinkedList<E> concat(E element); E first(); SingleLinkedList<E> rest(); E get(int index); @Override Iterator<E> iterator(); C fill(C target); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
SingleLinkedList implements Iterable<E>, Serializable { public boolean isEmpty() { return head == null; } SingleLinkedList();  SingleLinkedList(List<? extends E> list);  SingleLinkedList(Iterable<? extends E> iterable); private  SingleLinkedList(Node<E> head); boolean isEmpty(); int size(); SingleLinkedList<E> concat(E element); E first(); SingleLinkedList<E> rest(); E get(int index); @Override Iterator<E> iterator(); C fill(C target); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }