@Test
public void testCutPolygon() throws Exception {

    Polygon polygon = (Polygon) wKTReader.read("POLYGON (( 0 0 ,10 0, 10 10, 0 10, 0 0 ))");
    Polygon cutter = (Polygon) wKTReader.read("POLYGON (( 2 2  ,7 2, 7 7, 2 7, 2 2))");
    //Test cut a polygon inside
    List<Polygon> result = GeometryEdit.cutPolygonWithPolygon(polygon, cutter);
    assertEquals(result.get(0).getNumInteriorRing(), 1);
    assertEquals(result.get(0).getInteriorRingN(0).getEnvelopeInternal(), cutter.getEnvelopeInternal());
    //Test cut a polygon outside
    cutter = (Polygon) wKTReader.read("POLYGON (( 2 -1.8153735632183903, 7.177873563218391 -1.8153735632183903, 7.177873563218391 7, 2 7, 2 -1.8153735632183903 ))");
    result = GeometryEdit.cutPolygonWithPolygon(polygon, cutter);
    assertEquals(result.get(0), wKTReader.read("POLYGON (( 2 0, 0 0, 0 10, 10 10, 10 0, 7.177873563218391 0, 7.177873563218391 7, 2 7, 2 0 ))"));
}