test_class.declarator: rangePartHeaderSerializer = new RangePartHeaderSerializer()
test_class.modifier: private final
test_class.original_string: private final RangePartHeaderSerializer rangePartHeaderSerializer = new RangePartHeaderSerializer();
test_class.type: RangePartHeaderSerializer
test_class.var_name: rangePartHeaderSerializer
test_class.file: http/src/test/java/ro/polak/http/protocol/serializer/impl/RangePartHeaderSerializerTest.java
test_class.identifier: RangePartHeaderSerializerTest
test_case.body: @Test
      public void shouldReturnLengthForASingeRange() {
          Range range = new Range(333L, 1234L);
          String boundary = "BBBOOUUNNNDDAARRYY";
          String contentType = "application/pdf";
          long totalLength = 12345L;
          long computedLength = rangePartHeaderSerializer
                  .getPartHeadersLength(Collections.singletonList(range), boundary, contentType, totalLength);
  
          assertThat(computedLength, is(0L));
      }
test_case.class_method_signature: RangePartHeaderSerializerTest.shouldReturnLengthForASingeRange()
test_case.full_signature: @Test public void shouldReturnLengthForASingeRange()
test_case.identifier: shouldReturnLengthForASingeRange
test_case.invocations: getPartHeadersLength singletonList assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnLengthForASingeRange()
focal_class.declarator: NEW_LINE = "\r\n"
focal_class.modifier: private static final
focal_class.original_string: private static final String NEW_LINE = "\r\n";
focal_class.type: String
focal_class.var_name: NEW_LINE
focal_class.declarator: DASH_DASH = "--"
focal_class.modifier: private static final
focal_class.original_string: private static final String DASH_DASH = "--";
focal_class.type: String
focal_class.var_name: DASH_DASH
focal_class.declarator: RANGE_DIGITS_LENGTH = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int RANGE_DIGITS_LENGTH = 3;
focal_class.type: int
focal_class.var_name: RANGE_DIGITS_LENGTH
focal_class.file: http/src/main/java/ro/polak/http/protocol/serializer/impl/RangePartHeaderSerializer.java
focal_class.identifier: RangePartHeaderSerializer
focal_class.interfaces: implements Serializer<RangePartHeader>
focal_class.class_method_signature: RangePartHeaderSerializer.serialize(final RangePartHeader input)
focal_class.full_signature: @Override public String serialize(final RangePartHeader input)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (final RangePartHeader input)
focal_class.return: String
focal_class.signature: String serialize(final RangePartHeader input)
focal_class.class_method_signature: RangePartHeaderSerializer.serializeLastBoundaryDeliminator(final String boundary)
focal_class.full_signature: public String serializeLastBoundaryDeliminator(final String boundary)
focal_class.identifier: serializeLastBoundaryDeliminator
focal_class.modifiers: public
focal_class.parameters: (final String boundary)
focal_class.return: String
focal_class.signature: String serializeLastBoundaryDeliminator(final String boundary)
focal_class.class_method_signature: RangePartHeaderSerializer.getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_class.full_signature: public long getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_class.identifier: getPartHeadersLength
focal_class.modifiers: public
focal_class.parameters: (final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_class.return: long
focal_class.signature: long getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_method.body: public long getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength) {
          if (ranges.size() < 2) {
              return 0;
          }
  
          String partHeader = serialize(new RangePartHeader(new Range(0L, 0L), boundary, contentType, 0L));
          int partHeaderWithoutDigits = partHeader.length() - RANGE_DIGITS_LENGTH;
  
          long partHeadersLength = 0;
  
          // Initial new line
          partHeadersLength += NEW_LINE.length();
  
          for (Range range : ranges) {
              partHeadersLength += NEW_LINE.length()
                      + partHeaderWithoutDigits
                      + Long.toString(range.getFrom()).length()
                      + Long.toString(range.getTo()).length()
                      + Long.toString(totalLength).length();
          }
  
          partHeadersLength += serializeLastBoundaryDeliminator(boundary).length();
  
          return partHeadersLength;
      }
focal_method.class_method_signature: RangePartHeaderSerializer.getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_method.full_signature: public long getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_method.identifier: getPartHeadersLength
focal_method.invocations: size serialize length length length length toString getFrom length toString getTo length toString length serializeLastBoundaryDeliminator
focal_method.modifiers: public
focal_method.parameters: (final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)
focal_method.return: long
focal_method.signature: long getPartHeadersLength(final List<Range> ranges,
                                       final String boundary,
                                       final String contentType,
                                       final long totalLength)