code: public int convertBoundaryToRelativePosition(int absolutePosition) {
          if (absolutePosition < lower || absolutePosition > upper)
              throw new IllegalArgumentException("Position outside this range (" + absolutePosition + ") this=" + this + ".");
  
          if (reversed)
              return upper - absolutePosition;
          else
              return absolutePosition - lower;
      }
docs: Returns relative boundary position inside this range.
  
  @param absolutePosition absolute boundary position (in the same coordinates as this range boundaries)
  @return relative boundary position inside this range