code: public synchronized void insert(long data) {
          resetIfNeeded();
          long index = 0;
          if(data >= this.upperBound) {
              index = nBuckets - 1;
          } else if(data < 0) {
              logger.error(data + " can't be bucketed because it is negative!");
              return;
          } else {
              index = data / step;
          }
          if(index < 0 || index >= nBuckets) {
              // This should be dead code. Defending against code changes in
              // future.
              logger.error(data + " can't be bucketed because index is not in range [0,nBuckets).");
              return;
          }
          buckets[(int) index]++;
          sum += data;
          size++;
      }
docs: Insert a value into the right bucket of the histogram. If the value is
  larger than any bound, insert into the last bucket. If the value is less
  than zero, then ignore it.
  
  @param data The value to insert into the histogram