code: public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException {
                  Coordinate[] coordinates = geom.getCoordinates();
                  if (coordinates.length != 4) {
                          throw new IllegalArgumentException("The geometry must be a triangle");
                  }
                  return new Triangle(coordinates[0],coordinates[1],coordinates[2]);
          }
docs: A factory to create a DTriangle from a Geometry
  
  @param geom
  @return
  @throws IllegalArgumentException
  If there are not exactly 3 coordinates in geom.