code: private Range<RowKeyWrapper> rowRangeToRange(RowRange btRange) {
      final BoundType startBound;
      final ByteString startKey;
  
      switch (btRange.getStartKeyCase()) {
        case START_KEY_OPEN:
          startBound = BoundType.OPEN;
          startKey = btRange.getStartKeyOpen();
          break;
        case START_KEY_CLOSED:
          startBound = BoundType.CLOSED;
          startKey = btRange.getStartKeyClosed();
          break;
        case STARTKEY_NOT_SET:
          startBound = BoundType.CLOSED;
          startKey = ByteString.EMPTY;
          break;
        default:
          throw new IllegalArgumentException("Unexpected start key case: " +
              btRange.getStartKeyCase());
      }
  
      final BoundType endBound;
      final ByteString endKey;
      switch (btRange.getEndKeyCase()) {
        case END_KEY_OPEN:
          endBound = BoundType.OPEN;
          endKey = btRange.getEndKeyOpen();
          break;
        case END_KEY_CLOSED:
          endBound = BoundType.CLOSED;
          endKey = btRange.getEndKeyClosed();
          break;
        case ENDKEY_NOT_SET:
          endBound = BoundType.OPEN;
          endKey = ByteString.EMPTY;
          break;
        default:
          throw new IllegalArgumentException("Unexpected end key case: " + btRange.getEndKeyCase());
      }
  
      return boundedRange(startBound, startKey, endBound, endKey);
    }
docs: Convert Bigtable's {@link RowRange} -> guava {@link Range}.