code: public static @Nonnull JsonArray toJsonJLineString(@Nonnull double[][] lineString) {
          JsonArray points = array();
          for (double[] values : lineString) {
              JsonArray subArray = array();
              for (double value : values) {
                  subArray.add(primitive(value));
              }
              points.add(subArray);
          }
  
          return points;
      }
docs: Convert 2d array of doubles to a geojson style multi polygon in a 3D array of arrays of [latitude,longitude]
  arrays.
  @param lineString 2d array of doubles
  @return a JsonArray array