code: public static Extent forCoordinates(Collection<? extends Coordinate> coordinates) {
          requireNonNull(coordinates);
          if (coordinates.size() < 2) {
              throw new IllegalArgumentException();
          }
          double minLatitude = Double.MAX_VALUE;
          double maxLatitude = -Double.MAX_VALUE;
          double minLongitude = Double.MAX_VALUE;
          double maxLongitude = -Double.MAX_VALUE;
  
          for (Coordinate coordinate : coordinates) {
              minLatitude = Math.min(minLatitude, coordinate.getLatitude());
              maxLatitude = Math.max(maxLatitude, coordinate.getLatitude());
              minLongitude = Math.min(minLongitude, coordinate.getLongitude());
              maxLongitude = Math.max(maxLongitude, coordinate.getLongitude());
          }
          return new Extent(new Coordinate(minLatitude, minLongitude), new Coordinate(maxLatitude, maxLongitude));
      }
docs: creates the extent of the given coordinates.
  
  @param coordinates
  the coordinates
  @return Extent for the coorinates
  @throws java.lang.IllegalArgumentException
  when less than 2 coordinates or null are passed in
  @throws NullPointerException
  when coordinates is null