code: public static List<Polygon> createSimpleDirectionArrow( Geometry... geometries ) {
          List<Polygon> polygons = new ArrayList<>();
          for( Geometry geometry : geometries ) {
              for( int i = 0; i < geometry.getNumGeometries(); i++ ) {
                  Geometry geometryN = geometry.getGeometryN(i);
                  if (geometryN instanceof LineString) {
                      LineString line = (LineString) geometryN;
                      polygons.addAll(makeArrows(line));
                  } else if (geometryN instanceof Polygon) {
                      Polygon polygonGeom = (Polygon) geometryN;
                      LineString exteriorRing = polygonGeom.getExteriorRing();
                      polygons.addAll(makeArrows(exteriorRing));
                      int numInteriorRing = polygonGeom.getNumInteriorRing();
                      for( int j = 0; j < numInteriorRing; j++ ) {
                          LineString interiorRingN = polygonGeom.getInteriorRingN(j);
                          polygons.addAll(makeArrows(interiorRingN));
                      }
                  }
              }
          }
          return polygons;
      }
docs: Creates simple arrow polygons in the direction of the coordinates.
  
  @param geometries the geometries (lines and polygons) for which to create the arrows.
  @return the list of polygon arrows.