code: public static MultiPolygon extractWalls(LineString lineString, double height) {
          GeometryFactory factory = lineString.getFactory();
          //Extract the walls        
          Coordinate[] coords = lineString.getCoordinates();
          Polygon[] walls = new Polygon[coords.length - 1];
          for (int i = 0; i < coords.length - 1; i++) {
              walls[i] = extrudeEdge(coords[i], coords[i + 1], height, factory);
          }
          return lineString.getFactory().createMultiPolygon(walls);
      }
docs: Extrude the LineString as a set of walls.
  @param lineString
  @param height
  @return