@Test
public void curvePolygon() throws Exception {

    // perfect circle!
    WKTReader reader = new WKTReader2();
    String WKT;
    Polygon polygon;
    Geometry geometry;
    
    WKT = "CURVEPOLYGON(CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 143.62025166838282 -30.037497356076827))";
    geometry = reader.read(WKT);
    assertNotNull("read curvepolygon", geometry);
    assertTrue( geometry instanceof Polygon );
    polygon = (Polygon) geometry;
    assertTrue(polygon.getExteriorRing() instanceof CircularRing);
    assertTrue( "ring", polygon.getExteriorRing().isClosed() );
    assertEquals("segmented ring", 51, polygon.getExteriorRing().getNumPoints());
    assertEquals( "no holes", 0, polygon.getNumInteriorRing() );
    
    WKT = "CURVEPOLYGON((144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))";
    polygon = (Polygon) reader.read( WKT );
    assertTrue( "ring", polygon.getExteriorRing().isClosed() );
    assertEquals( "no holes", 0, polygon.getNumInteriorRing() );        
    
    WKT = "CURVEPOLYGON("+
          "CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),"+
          "(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))";
    
    polygon = (Polygon) reader.read( WKT );
    assertTrue( "ring", polygon.getExteriorRing().isClosed() );
    assertTrue(polygon.getExteriorRing() instanceof CircularRing);
    assertEquals("one holes", 1, polygon.getNumInteriorRing());
    assertFalse(polygon.getInteriorRingN(0) instanceof CircularRing);
    WKT = "CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0)), CIRCULARSTRING(1.7 1, 1.4 0.4, 1.6 0.4, 1.6 0.5, 1.7 1) )";
    polygon = (Polygon) reader.read(WKT);
    assertTrue("ring", polygon.getExteriorRing().isClosed());
    assertTrue(polygon.getExteriorRing() instanceof CompoundRing);
    assertEquals("one holes", 1, polygon.getNumInteriorRing());
    assertTrue(polygon.getInteriorRingN(0) instanceof CircularRing);
}