@Test
public void testClipPoly3DNewVertices() throws Exception {

    SimpleFeatureCollection features = fsMeters.getFeatures();
    ClipProcess cp = new ClipProcess();
    SimpleFeatureCollection result = cp.execute(features, new WKTReader().read("POLYGON((0 5000, 0 10000, 10000 10000, 10000 5000, 0 5000))"), true);
    assertEquals(1, result.size());
    SimpleFeatureIterator fi = result.features();
    // check the first polygon
    SimpleFeature f = fi.next();
    MultiPolygon mp = (MultiPolygon) f.getDefaultGeometry();
    assertEquals(1, mp.getNumGeometries());
    Polygon p = (Polygon) mp.getGeometryN(0);
    assertEquals(0, p.getNumInteriorRing());
    LineString shell = p.getExteriorRing();
    CoordinateSequence cs = shell.getCoordinateSequence();
    assertEquals(5, cs.size());
    assertOrdinates(0, 5000, 1, cs, 0);
    assertOrdinates(0, 10000, 2, cs, 1);
    assertOrdinates(10000, 10000, 2, cs, 2);
    assertOrdinates(10000, 5000, 1, cs, 3);
    assertOrdinates(0, 5000, 1, cs, 4);
    // ensure no second
    assertFalse(fi.hasNext());
    fi.close();
}