CoordinateSequence2D implements CoordinateSequence, Cloneable { public Envelope expandEnvelope(Envelope env) { if (env == null) env = new Envelope(); for (int i = 0; i < x.length; i++) { env.expandToInclude(x[i], y[i]); } return env; } CoordinateSequence2D(int n);  CoordinateSequence2D(double... xy); int getDimension(); Coordinate getCoordinate(int index); Coordinate getCoordinateCopy(int index); void getCoordinate(int index, Coordinate coord); double getX(int index); double getY(int index); double getOrdinate(int index, int ordinateIndex); int size(); void setOrdinate(int index, int ordinateIndex, double value); void setX(int index, double value); void setY(int index, double value); void setXY(int index, double x, double y); Coordinate[] toCoordinateArray(); Envelope expandEnvelope(Envelope env); @Override Object clone(); CoordinateSequence copy();  }
@Test public void testExpandEnvelope() { Envelope env = new Envelope(); CoordinateSequence2D cs = new CoordinateSequence2D(-5.0, 10.0, 5.0, -10.0); env = cs.expandEnvelope(env); assertEquals(-5.0, env.getMinX(), TOL); assertEquals(-10.0, env.getMinY(), TOL); assertEquals(5.0, env.getMaxX(), TOL); assertEquals(10.0, env.getMaxY(), TOL); }