@Test
public void simpleSmallCoverage() throws Exception {

    GridCoverage2D cov = buildSmallCoverage();
    
    final int perimeters[] = { 4, 16, 4 };
    final int areas[] = {1, 7, 1};
    int band = 0;
    Set<Double> outsideValues = Collections.singleton(0D);
    SimpleFeatureCollection fc = process.execute(cov, 0, Boolean.TRUE, null, null, null, null);
    assertEquals(3, fc.size());
    
    FeatureIterator iter = fc.features();
    try {
        while (iter.hasNext()) {
            SimpleFeature feature = (SimpleFeature) iter.next();
            Polygon poly = (Polygon) feature.getDefaultGeometry();
            int value = ((Number) feature.getAttribute("value")).intValue();
            assertEquals(perimeters[value - 1], (int) (poly.getBoundary().getLength() + 0.5));
            assertEquals(areas[value - 1], (int) (poly.getArea() + 0.5));
        }
    } finally {
        iter.close();
    }
}