}
DataStore ds = new MemoryDataStore(mm);
FeatureCache cache = new GridFeatureCache(ds.getFeatureSource(featureType.getTypeName()), 4, 4, MemoryStorage.createInstance());
FilterFactory ff = new FilterFactoryImpl();
Filter f1 = ff.bbox("the_geom", 0, 0, 4.4, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
Envelope e1 = new Envelope(0, 4.4, 0, 4.4);
Filter f2 = ff.bbox("the_geom", 0, 4.6, 4.4, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
Envelope e2 = new Envelope(0, 4.4, 4.6, 8.5);
Filter f3 = ff.bbox("the_geom", 4.6, 0, 8.5, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
Envelope e3 = new Envelope(4.6, 8.5, 0, 4.4);
Filter f4 = ff.bbox("the_geom", 4.6, 4.6, 8.5, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
Envelope e4 = new Envelope(4.6, 8.5, 4.6, 8.5);
//there should be two features in each region
FeatureCollection fc = cache.getFeatures(f1);
assertEquals(2, fc.size());