@Test
public void shouldSerializeRangeProperly() {

    Range range = new Range(333L, 1234L);
    String boundary = "BBBOOUUNNNDDAARRYY";
    String contentType = "application/pdf";
    long totalLength = 12345L;
    RangePartHeader rangePartHeader = new RangePartHeader(range, boundary, contentType, totalLength);
    String serialized = rangePartHeaderSerializer.serialize(rangePartHeader);
    assertThat(serialized, startsWith("--" + boundary + "\r\n"));
    assertThat(serialized, endsWith("\r\n\r\n"));
    assertThat(serialized, containsString("\r\nContent-Type: " + contentType + "\r\n"));
    assertThat(serialized, containsString("\r\nContent-Range: bytes 333-1234/12345\r\n"));
}