code: public T clamp(T value) {
          if (value == null)
              throw new IllegalArgumentException("value must not be null");
  
          if (value.compareTo(mLower) < 0) {
              return mLower;
          } else if (value.compareTo(mUpper) > 0) {
              return mUpper;
          } else {
              return value;
          }
      }
docs: Clamps {@code value} to this range.
  <p/>
  <p>If the value is within this range, it is returned.  Otherwise, if it
  is {@code <} than the lower endpoint, the lower endpoint is returned,
  else the upper endpoint is returned. Comparisons are performed using the
  {@link Comparable} interface.</p>
  
  @param value a non-{@code null} {@code T} reference
  @return {@code value} clamped to this range.