ListFeatureCollection extends AbstractFeatureCollection implements Collection<SimpleFeature> { @Override public int size() { return list.size(); } ListFeatureCollection(SimpleFeatureType schema);  ListFeatureCollection(SimpleFeatureType schema, List<SimpleFeature> list );  ListFeatureCollection(SimpleFeatureType schema, SimpleFeature array[] );  ListFeatureCollection(SimpleFeatureCollection copy ); @Override int size(); @Override boolean add(SimpleFeature f); @Override void clear(); @Override SimpleFeatureIterator features(); @Override synchronized ReferencedEnvelope getBounds(); @Override boolean isEmpty(); @Override SimpleFeatureCollection subCollection(Filter filter); @Override SimpleFeatureCollection sort(SortBy order); @Override boolean remove(Object o); @Override boolean addAll(Collection<? extends SimpleFeature> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c);  }
@Test public void size() { createPointFeatures(WORLD, 42); assertEquals(42, featureCollection.size()); }