@Test
public void toEnvelope() {

    Coordinate[] coords = getPolyCoords();
    GeometryFactory gf = new GeometryFactory();
    Geometry geom = gf.createPolygon(gf.createLinearRing(coords), null);
    
    ReferencedEnvelope refEnv = JTS.toEnvelope(geom);
    assertTrue(geom.getEnvelopeInternal().equals(refEnv));
}