code: public SimpleFeature convertDwgLine( String typeName, String layerName, DwgLine line, int id ) {
          double[] p1 = line.getP1();
          double[] p2 = line.getP2();
          Point2D[] ptos = new Point2D[]{new Point2D.Double(p1[0], p1[1]),
                  new Point2D.Double(p2[0], p2[1])};
          CoordinateList coordList = new CoordinateList();
          for( int j = 0; j < ptos.length; j++ ) {
              Coordinate coord = new Coordinate(ptos[j].getX(), ptos[j].getY(), 0.0);
              coordList.add(coord);
          }
  
          SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
          b.setName(typeName);
          b.setCRS(crs);
          b.add(THE_GEOM, LineString.class);
          b.add(LAYER, String.class);
          SimpleFeatureType type = b.buildFeatureType();
          SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
          Geometry lineString = gF.createLineString(coordList.toCoordinateArray());
          Object[] values = new Object[]{lineString, layerName};
          builder.addAll(values);
          return builder.buildFeature(typeName + "." + id);
      }
docs: Builds a line feature from a dwg line.