@Test
public void checkThatHolesArePresentInPolygons() throws Exception {

    final float[][] DATA = {
        {1, 1, 1, 1, 0, 1, 1, 1, 1},
        {1, 0, 0, 1, 0, 1, 0, 0, 1},
        {1, 0, 0, 1, 0, 1, 0, 0, 1},
        {1, 1, 1, 1, 0, 1, 1, 1, 1}
    };
    final int NUM_POLYS = 2;
    GridCoverage2D cov = covFactory.create(
            "coverage",
            DATA,
            new ReferencedEnvelope(0, DATA[0].length, 0, DATA.length, null));
    
    SimpleFeatureCollection fc = process.execute(cov, 0, Boolean.TRUE, null, null, null, null);
    assertEquals(NUM_POLYS, fc.size());
    SimpleFeatureIterator iter = fc.features();
    try {
        while (iter.hasNext()) {
            Polygon poly = (Polygon) iter.next().getDefaultGeometry();
            assertEquals(1, poly.getNumInteriorRing());
        }
    } finally {
        iter.close();
    }
}