code: private static boolean isLinearRing(LineString lineString) {
      if (lineString.coordinates().size() < 4) {
        throw new GeoJsonException("LinearRings need to be made up of 4 or more coordinates.");
      }
      if (!(lineString.coordinates().get(0).equals(
        lineString.coordinates().get(lineString.coordinates().size() - 1)))) {
        throw new GeoJsonException("LinearRings require first and last coordinate to be identical.");
      }
      return true;
    }
docs: Checks to ensure that the LineStrings defining the polygon correctly and adhering to the linear
  ring rules.
  
  @param lineString {@link LineString} the polygon geometry
  @return true if number of coordinates are 4 or more, and first and last coordinates
  are identical, else false
  @throws GeoJsonException if number of coordinates are less than 4,
  or first and last coordinates are not identical
  @since 3.0.0