### Question:
PointList implements Iterable<GHPoint3D>, PointAccess { public void reverse() { int max = size / 2; for (int i = 0; i < max; i++) { int swapIndex = size - i - 1; double tmp = latitudes[i]; latitudes[i] = latitudes[swapIndex]; latitudes[swapIndex] = tmp; tmp = longitudes[i]; longitudes[i] = longitudes[swapIndex]; longitudes[swapIndex] = tmp; if (is3D) { tmp = elevations[i]; elevations[i] = elevations[swapIndex]; elevations[swapIndex] = tmp; } } } PointList();  PointList( int cap, boolean is3D ); @Override boolean is3D(); @Override int getDimension(); @Override void ensureNode( int nodeId ); @Override void setNode( int nodeId, double lat, double lon ); @Override void setNode( int nodeId, double lat, double lon, double ele ); void set( int index, double lat, double lon, double ele ); void add( double lat, double lon ); void add( double lat, double lon, double ele ); void add( PointAccess nodeAccess, int index ); void add( GHPoint point ); void add( PointList points ); int size(); int getSize(); boolean isEmpty(); @Override double getLat( int index ); @Override double getLatitude( int index ); @Override double getLon( int index ); @Override double getLongitude( int index ); @Override double getElevation( int index ); @Override double getEle( int index ); void reverse(); void clear(); void trimToSize( int newSize ); @Override String toString(); List<Double[]> toGeoJson(); List<Double[]> toGeoJson( boolean includeElevation ); @Override boolean equals( Object obj ); PointList clone( boolean reverse ); PointList copy( int from, int end ); @Override int hashCode(); double calcDistance( DistanceCalc calc ); void parse2DJSON( String str ); GHPoint3D toGHPoint( int index ); @Override Iterator<GHPoint3D> iterator(); static PointList EMPTY; }### Answer:
@Test public void testReverse() { PointList instance = new PointList(); instance.add(1, 1); instance.reverse(); assertEquals(1, instance.getLongitude(0), 1e-7); instance = new PointList(); instance.add(1, 1); instance.add(2, 2); PointList clonedList = instance.clone(false); instance.reverse(); assertEquals(2, instance.getLongitude(0), 1e-7); assertEquals(1, instance.getLongitude(1), 1e-7); assertEquals(clonedList, instance.clone(true)); }