AList extends AbstractACollection<T, AList<T>> implements Serializable { @SuppressWarnings("unchecked") public static <T> AList<T> nil() { return (AList<T>) Nil.INSTANCE; } protected  AList(int size); @SuppressWarnings("unchecked") static AList<T> nil(); static AList<T> create(Iterable<T> elements); static AList<T> create(List<T> elements); @SafeVarargs static AList<T> create(T... elements); java.util.List<T> asJavaUtilList(); @Override Collection<T> asJavaUtilCollection(); abstract AOption<T> optHead(); abstract T head(); abstract AList<T> tail(); AList<T> cons(T el); AList<T> reverse(); int size(); @Override AList<T> toList(); @Override AList<X> map(AFunction1<? super T, ? extends X, E> f); @Override AList<X> flatMap(AFunction1<? super T, ? extends Iterable<X>, E> f); @SuppressWarnings("unchecked") @Override AList<X> flatten(); @Override AList<X> collect(APartialFunction<? super T, ? extends X, E> pf); @Override Iterator<T> iterator(); static final AList nil; }
@Test public void testNil() { assertEquals(0, AList.nil().size()); assertTrue(AList.nil().asJavaUtilList().isEmpty()); }