/** * Prepend the given value to this list. * * @param a The value to prepend. * @return A non-empty list with an extra element. */ public NonEmptyList<A> cons(final A a) { return nel(a, tail.cons(head)); }
/** * Returns a <code>List</code> projection of this list. * * @return A <code>List</code> projection of this list. */ public List<A> toList() { return tail.cons(head); }