code: public T[] simplify(T[] points,
                          double tolerance,
                          boolean highestQuality) {
  
          if (points == null || points.length <= 2) {
              return points;
          }
  
          double sqTolerance = tolerance * tolerance;
  
          if (!highestQuality) {
              points = simplifyRadialDistance(points, sqTolerance);
          }
  
          points = simplifyDouglasPeucker(points, sqTolerance);
  
          return points;
      }
docs: Simplifies a list of points to a shorter list of points.
  @param points original list of points
  @param tolerance tolerance in the same measurement as the point coordinates
  @param highestQuality <tt>true</tt> for using Douglas-Peucker only,
  <tt>false</tt> for using Radial-Distance algorithm before
  applying Douglas-Peucker (should be a bit faster)
  @return simplified list of points