private int getIndex(long value) {
      if (value < this.binsMin) {
        return 0;
      } else if (value > this.bins10XMax) {
        return this.counts.length - 1;
      } else if (value >= this.binsMax) {
        return this.counts.length - 2;
      }
      // compute the position
      return 1
        + (int) ((value - this.binsMin) * (this.counts.length - 3) / (this.binsMax - this.binsMin));

    }
The constructor for creating a Bins with last Bins.
hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/FastLongHistogram.java