test_class.file: http/src/test/java/ro/polak/http/protocol/parser/impl/RangeParserTest.java
test_class.identifier: RangeParserTest
test_case.body: @Test
      public void shouldParseBasicValue() throws MalformedInputException {
          RangeParser rangeParser = new RangeParser();
          List<Range> rageList = rangeParser.parse("bytes=1-100");
          assertThat(rageList.size(), is(1));
          assertThat(rageList.get(0).getFrom(), is(1L));
          assertThat(rageList.get(0).getTo(), is(100L));
      }
test_case.class_method_signature: RangeParserTest.shouldParseBasicValue()
test_case.full_signature: @Test public void shouldParseBasicValue()
test_case.identifier: shouldParseBasicValue
test_case.invocations: parse assertThat size is assertThat getFrom get is assertThat getTo get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldParseBasicValue()
focal_class.declarator: START_WORD = "bytes="
focal_class.modifier: private static final
focal_class.original_string: private static final String START_WORD = "bytes=";
focal_class.type: String
focal_class.var_name: START_WORD
focal_class.declarator: RANGES_SEPARATOR = ","
focal_class.modifier: private static final
focal_class.original_string: private static final String RANGES_SEPARATOR = ",";
focal_class.type: String
focal_class.var_name: RANGES_SEPARATOR
focal_class.declarator: RANGE_SEPARATOR = "-"
focal_class.modifier: private static final
focal_class.original_string: private static final String RANGE_SEPARATOR = "-";
focal_class.type: String
focal_class.var_name: RANGE_SEPARATOR
focal_class.file: http/src/main/java/ro/polak/http/protocol/parser/impl/RangeParser.java
focal_class.identifier: RangeParser
focal_class.interfaces: implements Parser<List<Range>>
focal_class.class_method_signature: RangeParser.parse(final String input)
focal_class.full_signature: @Override public List<Range> parse(final String input)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (final String input)
focal_class.return: List<Range>
focal_class.signature: List<Range> parse(final String input)
focal_class.class_method_signature: RangeParser.getRange(final String[] values)
focal_class.full_signature: private Range getRange(final String[] values)
focal_class.identifier: getRange
focal_class.modifiers: private
focal_class.parameters: (final String[] values)
focal_class.return: Range
focal_class.signature: Range getRange(final String[] values)
focal_method.body: @Override
      public List<Range> parse(final String input) throws MalformedInputException {
          List<Range> rangeList = new ArrayList<>();
  
          String inputNormalized = input.toLowerCase().trim();
          if (!inputNormalized.startsWith(START_WORD)) {
              throw new MalformedInputException("Header value must start with bytes=");
          }
  
          String[] rangesString = inputNormalized.substring(START_WORD.length()).split(RANGES_SEPARATOR);
          for (String rangeString : rangesString) {
              if (rangeString.indexOf(RANGE_SEPARATOR) == -1) {
                  throw new MalformedInputException("Invalid range value " + rangeString);
              }
  
              String[] values = rangeString.split(RANGE_SEPARATOR);
  
              if (values.length != 2) {
                  throw new MalformedInputException("Invalid range value " + rangeString);
              }
  
              rangeList.add(getRange(values));
          }
  
          return rangeList;
      }
focal_method.class_method_signature: RangeParser.parse(final String input)
focal_method.full_signature: @Override public List<Range> parse(final String input)
focal_method.identifier: parse
focal_method.invocations: trim toLowerCase startsWith split substring length indexOf split add getRange
focal_method.modifiers: @Override public
focal_method.parameters: (final String input)
focal_method.return: List<Range>
focal_method.signature: List<Range> parse(final String input)