public class MaxFeaturesFeatureCollectionTest extends
FeatureCollectionWrapperTestSupport {
public void testSize() throws Exception {
// in the common case it's as big as the max
MaxSimpleFeatureCollection max = new MaxSimpleFeatureCollection(delegate, 2);
assertEquals(2, max.size());
// however if we skip much it's going to be just as big as the remainder
max = new MaxSimpleFeatureCollection(delegate, delegate.size() - 1, 10);
assertEquals(1, max.size());
// and if we skip more than the size
max = new MaxSimpleFeatureCollection(delegate, delegate.size() + 1, 10);
assertEquals(0, max.size());
}