CoordinateSequence2D implements CoordinateSequence, Cloneable { public Coordinate getCoordinate(int index) { return new Coordinate(x[index], y[index]); } 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 testGetCoordinate() { CoordinateSequence2D cs = new CoordinateSequence2D(1.1, 1.2, 2.1, 2.2); Coordinate c0 = cs.getCoordinate(0); assertEquals(1.1, c0.x, TOL); assertEquals(1.2, c0.y, TOL); Coordinate c1 = cs.getCoordinate(1); assertEquals(2.1, c1.x, TOL); assertEquals(2.2, c1.y, TOL); }
@Test public void testGetCoordinate_int_Coordinate() { CoordinateSequence2D cs = new CoordinateSequence2D(1.1, 1.2, 2.1, 2.2); Coordinate c = new Coordinate(); cs.getCoordinate(0, c); assertEquals(1.1, c.x, TOL); assertEquals(1.2, c.y, TOL); cs.getCoordinate(1, c); assertEquals(2.1, c.x, TOL); assertEquals(2.2, c.y, TOL); }