pg.setGeometryFactory(geometryFactory);
pg.setBoundingBox(new Envelope(0,10,0,10));
pg.setGenerationAlgorithm(PolygonGenerator.BOX);
pg.setNumberPoints(1000);
Polygon pt = (Polygon) pg.create();
GMLWriter out = new GMLWriter();
out.setPrefix("");
out.write(pt,getWriter());
GMLReader in = new GMLReader();
Polygon pt2 = (Polygon) in.read(getReader(),geometryFactory);
assertTrue("The input polygon is not the same as the output polygon",pt.equals(pt2));
}