code: public Point getPointAtThreshold(double threshold) {
  
          //Return (closest) point number, precision, recall, whether it's interpolated or not
  
          //Binary search to find closest threshold
  
          int idx = Arrays.binarySearch(this.threshold, threshold);
          if (idx < 0) {
              //Not found (usual case). binarySearch javadoc:
              /*
              index of the search key, if it is contained in the array;
              otherwise, (-(insertion point) - 1).  The
              insertion point is defined as the point at which the
              key would be inserted into the array: the index of the first
              element greater than the key, or a.length if all
              elements in the array are less than the specified key.
              */
              idx = -idx - 1;
          }
  
          //At this point: idx = exact, on the next highest
          double thr = this.threshold[idx];
          double pr = precision[idx];
          double rec = recall[idx];
  
          return new Point(idx, thr, pr, rec);
      }
docs: Get the point (index, threshold, precision, recall) at the given threshold.<br>
  Note that if the threshold is not found exactly, the next highest threshold exceeding the requested threshold
  is returned
  
  @param threshold Threshold to get the point for
  @return point (index, threshold, precision, recall) at the given threshold