code: @Pure
  	public static double clampToNearestBounds(double value, double minBounds, double maxBounds) {
  		assert minBounds <= maxBounds : AssertMessages.lowerEqualParameters(1, minBounds, 2, maxBounds);
  		final double center = (minBounds + maxBounds) / 2;
  		if (value <= center) {
  			return minBounds;
  		}
  		return maxBounds;
  	}
docs: Replies the {@code value} clamped to
  the nearest bounds.
  If |{@code value}-{@code minBounds}| &gt;
  |{@code value}-{@code maxBounds}| then the
  returned value is {@code maxBounds}; otherwise
  it is {@code minBounds}.
  
  @param value is the value to clamp.
  @param minBounds is the minimal allowed value.
  @param maxBounds is the maximal allowed value.
  @return {@code minBounds} or {@code maxBounds}.