code: private static boolean atLeastTwoPoints(Geometry[] points,
                                              int initialNumberOfPoints) throws SQLException {
          if (points.length < 1) {
              throw new SQLException("The geometry collection must not be empty");
          }
          return atLeastTwoPoints(points[0].getFactory().createGeometryCollection(points),
                  initialNumberOfPoints);
      }
docs: Returns true as soon as we know the collection contains at least two
  points. Start counting from the initial number of points.
  
  @param points                Collection of points
  @param initialNumberOfPoints The initial number of points
  @return True as soon as we know the collection contains at least two
  points.