code: public static String feature2Dxf( FeatureMate featureMate, String layerName, String elevationAttrName, boolean suffix,
              boolean force2CoordsToLine ) {
          Geometry g = featureMate.getGeometry();
  
          if (EGeometryType.isPoint(g)) {
              return point2Dxf(featureMate, layerName, elevationAttrName);
          } else if (EGeometryType.isLine(g)) {
              return lineString2Dxf(featureMate, layerName, elevationAttrName, force2CoordsToLine);
          } else if (EGeometryType.isPolygon(g)) {
              return polygon2Dxf(featureMate, layerName, elevationAttrName, suffix);
          } else if (g instanceof GeometryCollection) {
              StringBuilder sb = new StringBuilder();
              for( int i = 0; i < g.getNumGeometries(); i++ ) {
                  SimpleFeature ff = SimpleFeatureBuilder.copy(featureMate.getFeature());
                  ff.setDefaultGeometry(g.getGeometryN(i));
                  FeatureMate fm = new FeatureMate(ff);
                  sb.append(feature2Dxf(fm, layerName, elevationAttrName, suffix, force2CoordsToLine));
              }
              return sb.toString();
          } else {
              return null;
          }
      }
docs: Write a {@link SimpleFeature} to dxf string.
  
  @param featureMate the feature to convert.
  @param layerName the layer name in case none is in the attributes.
  @param elevationAttrName the attribute defining elevation or <code>null</code>.
  @param suffix <code>true</code> if suffix is needed.
  @param force2CoordsToLine if <code>true</code>, lines that are composed of just 2 coordinates
  will be handled as LINE instead of the default which is POLYLINE.
  @return the string representation.