code: private Range<RangeTimeUUID> toRange(@Nullable UUID start, @Nullable UUID end, boolean reversed) {
          // If the range is reversed then start and end will also be reversed and must therefore be swapped.
          if (reversed) {
              UUID tmp = start;
              start = end;
              end = tmp;
          }
  
          if (start == null) {
              if (end == null) {
                  return Range.all();
              } else {
                  return Range.atMost(new RangeTimeUUID(end));
              }
          } else if (end == null) {
              return Range.atLeast(new RangeTimeUUID(start));
          }
          return Range.closed(new RangeTimeUUID(start), new RangeTimeUUID(end));
      }
docs: Converts a TimeUUID set of endpoints into a {@link Range}. of {@link RangeTimeUUID}s.  Both end points
  are considered closed; that is, they are included in the range.