code: public synchronized long getQuantile(double quantile) {
          resetIfNeeded();
          int total = 0;
          for(int i = 0; i < nBuckets; i++) {
              total += buckets[i];
              double currQuantile = ((double) total) / ((double) size);
              if(currQuantile >= quantile) {
                  return i * step;
              }
          }
          return 0;
      }
docs: Find the a value <em>n</em> such that the percentile falls within [
  <em>n</em>, <em>n + step</em>). This method does a <em>LINEAR</em> probe
  of the histogram. I.e., this method is O(nBuckets).
  
  @param quantile The percentile to find
  @return Lower bound associated with the percentile