title: How to create com.google.common.collect.Range with one boud changed?
body: <p>I need to create new <code>Range</code> object, changing only one (lower or upper) bound. Other bound must be unchanged.</p>
  
  <p>What is most convenient way to do that?</p>
  
  <p>I see method <code>com.google.common.collect.Range#range(C lower, BoundType lowerType, C upper, BoundType upperType)</code>, but when I need to change lower, I must copy upper value from my range - and be careful if upperBound exist at all. </p>
  
  <p>It looks rather ugly (example below). And I need similar code for changing upper bound. Is there easier way to do so?</p>
  
  <pre><code>if (range.hasUpperBound()) {
      range = Range.range(value, BoundType.CLOSED, range.upperEndpoint(), timeSpend.upperBoundType());
  } else {
      range = Range.upTo(value, BoundType.CLOSED);
  }
  </code></pre>