public static String getRangeHeaderString(ByteRange range) {
    switch (range.getType()) {
      case LAST_N_BYTES:
        return "bytes=-" + range.getLastNBytes();
      case FROM_START_OFFSET:
        return "bytes=" + range.getStartOffset() + "-";
      default:
        return "bytes=" + range.getStartOffset() + "-" + range.getEndOffset();
    }
  }
Build the range header value from a {@link ByteRange}
@param range the {@link ByteRange} representing the range
@return the range header value corresponding to {@code range}.
ambry-rest/src/test/java/com/github/ambry/rest/RestTestUtils.java