@Test
public void simplifyPolygon() {

    Point p0 = fac.createPoint( null, 0.0, 0.0, CRSUtils.EPSG_4326 );
    Point p1 = fac.createPoint( null, 10.0, 0.0, CRSUtils.EPSG_4326 );
    Point p2 = fac.createPoint( null, 10.0, 10.0, CRSUtils.EPSG_4326 );
    Point p3 = fac.createPoint( null, 10.0, 10.0, CRSUtils.EPSG_4326 );
    Point p4 = fac.createPoint( null, 0.0, 10.0, CRSUtils.EPSG_4326 );
    Point p5 = fac.createPoint( null, 1.0, 1.0, CRSUtils.EPSG_4326 );
    Point p6 = fac.createPoint( null, 1.0, 9.0, CRSUtils.EPSG_4326 );
    Point p7 = fac.createPoint( null, 9.0, 9.0, CRSUtils.EPSG_4326 );
    Point p8 = fac.createPoint( null, 9.0, 1.0, CRSUtils.EPSG_4326 );
    Point p9 = fac.createPoint( null, 1.0, 10.0, CRSUtils.EPSG_4326 );
    Ring exterior = fac.createLinearRing( null, CRSUtils.EPSG_4326, new PointsArray( p0, p1, p2, p3, p4 ) );
    Ring interior = fac.createLinearRing( null, CRSUtils.EPSG_4326, new PointsArray( p5, p6, p7, p8, p9 ) );
    Polygon polygon = fac.createPolygon( null, CRSUtils.EPSG_4326, exterior, Collections.singletonList( interior ) );
    Polygon simplified = (Polygon) simplifier.simplify( polygon );
    assertEquals(
                  "POLYGON ((0.000000 0.000000,10.000000 0.000000,10.000000 10.000000,10.000000 10.000000,0.000000 10.000000),(1.000000 1.000000,1.000000 9.000000,9.000000 9.000000,9.000000 1.000000,1.000000 10.000000))",
                  simplified.toString() );
}