protected Coordinate[] coordinates(boolean closed){
  Coordinate[] result=points.toArray(new Coordinate[points.size() + (closed ? 1 : 0)]);
  if (closed) {
    result[result.length - 1]=result[0];
  }
  return result;
}

protected Coordinate [ ] coordinates ( boolean closed ) { Coordinate [ ] result = points . toArray ( new Coordinate [ points . size ( ) + ( closed ? 1 : 0 ) ] ) ; if ( closed ) { result [ result . length - 1 ] = result [ 0 ] ; } return result ; }
copy all points to a new array
