@Test
public void simplifyMultiSurface() {

    // exterior 1
    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 );
    // interior 1
    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 );
    // exterior 2 (touches exterior 1)
    Point p10 = fac.createPoint( null, 10.0, 0.0, CRSUtils.EPSG_4326 );
    Point p11 = fac.createPoint( null, 20.0, 0.0, CRSUtils.EPSG_4326 );
    Point p12 = fac.createPoint( null, 20.0, 10.0, CRSUtils.EPSG_4326 );
    Point p13 = fac.createPoint( null, 20.0, 10.0, CRSUtils.EPSG_4326 );
    Point p14 = fac.createPoint( null, 10.0, 10.0, CRSUtils.EPSG_4326 );
    LineStringSegment seg0 = fac.createLineStringSegment( new PointsArray( p0, p1, p2, p3, p4 ) );
    LineStringSegment seg1 = fac.createLineStringSegment( new PointsArray( p5, p6, p7, p8, p9 ) );
    LineStringSegment seg2 = fac.createLineStringSegment( new PointsArray( p10, p11, p12, p13, p14 ) );
    Curve curve0 = fac.createCurve( null, CRSUtils.EPSG_4326, seg0 );
    Curve curve1 = fac.createCurve( null, CRSUtils.EPSG_4326, seg1 );
    Curve curve2 = fac.createCurve( null, CRSUtils.EPSG_4326, seg2 );
    Ring exteriorRing = fac.createRing( null, CRSUtils.EPSG_4326, Collections.singletonList( curve0 ) );
    Ring interiorRing = fac.createRing( null, CRSUtils.EPSG_4326, Collections.singletonList( curve1 ) );
    Ring exteriorRing2 = fac.createRing( null, CRSUtils.EPSG_4326, Collections.singletonList( curve2 ) );
    SurfacePatch patch0 = fac.createPolygonPatch( exteriorRing, Collections.singletonList( interiorRing ) );
    SurfacePatch patch1 = fac.createPolygonPatch( exteriorRing2, null );
    List<SurfacePatch> patches = new ArrayList<SurfacePatch>();
    patches.add( patch0 );
    patches.add( patch1 );
    Surface surface = fac.createSurface( null, patches, CRSUtils.EPSG_4326 );
    List<Surface> surfaces = new ArrayList<Surface>();
    surfaces.add( surface );
    surfaces.add( surface );
    MultiSurface<?> multiSurface = fac.createMultiSurface( null, CRSUtils.EPSG_4326, surfaces );
    MultiPolygon simplified = (MultiPolygon) simplifier.simplify( multiSurface );
    System.out.println( simplified );
    assertEquals(
                  "MULTIPOLYGON (((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)),((10.000000 0.000000,20.000000 0.000000,20.000000 10.000000,20.000000 10.000000,10.000000 10.000000)),((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)),((10.000000 0.000000,20.000000 0.000000,20.000000 10.000000,20.000000 10.000000,10.000000 10.000000)))",
                  simplified.toString() );
}