code: public List<HRegionLocation> adaptResponse(List<KeyOffset> responses) {
  
      List<HRegionLocation> regions = new ArrayList<>();
  
      // Starting by the first possible row, iterate over the sorted sampled row keys and create regions.
      byte[] startKey = HConstants.EMPTY_START_ROW;
  
      for (KeyOffset response : responses) {
        byte[] endKey = response.getKey().toByteArray();
  
        // Avoid empty regions.
        if (Bytes.equals(startKey, endKey)) {
          continue;
        }
        regions.add(createRegionLocation(startKey, endKey));
        startKey = endKey;
      }
  
      // Create one last region if the last region doesn't reach the end or there are no regions.
      byte[] endKey = HConstants.EMPTY_END_ROW;
      if (regions.isEmpty() || !Bytes.equals(startKey, endKey)) {
        regions.add(createRegionLocation(startKey, endKey));
      }
      return regions;
    }
docs: <p>adaptResponse.</p>
  
  @param responses a {@link java.util.List} object.
  @return a {@link java.util.List} object.