/** {@inheritDoc } */
 @Override
 public Surface createSurface(final SurfaceBoundary boundary) {
   // For now, our implementation has to assume that the boundary is a
   // polygon.
   Surface result = new JTSSurface(crs);
   Polygon poly = geomFact.createPolygon(boundary);
   // PENDING(jdc): the following line is 1.5 specific.
   // the result.getPatches() list is a generic list with a type of "? extends SurfacePatch"
   // we can compile without the generic if we cast down to List, but why do we need the cast?
   // Polygon extends SurfacePatch, so in theory this should work...
   // ((List<SurfacePatch>) result.getPatches()).add(poly);
   ((List) result.getPatches()).add(poly);
   return result;
 }
 protected DirectPosition createDirectPosition(final double x, final double y) {
   double[] coords = new double[2];
   coords[0] = x;
   coords[1] = y;
   return GEOMETRY_FACTORY.createDirectPosition(coords);
 }
 /**
  * A helper method for creating a lineString from an array of DirectPositions
  *
  * @param points
  * @return <tt>LineString</tt>
  */
 protected LineString createLineString(final DirectPosition[] points) {
   final LineString lineString =
       GEOMETRY_FACTORY.createLineString(new ArrayList(Arrays.asList(points)));
   return lineString;
 }