test_class.declarator: cookieParser = new CookieParser()
test_class.modifier: private static
test_class.original_string: private static Parser<Map<String, Cookie>> cookieParser = new CookieParser();
test_class.type: Parser<Map<String, Cookie>>
test_class.var_name: cookieParser
test_class.file: http/src/test/java/ro/polak/http/protocol/parser/impl/CookieParserTest.java
test_class.identifier: CookieParserTest
test_case.body: @Test
      public void shouldParseCookieHavingSpaceInValue() throws MalformedInputException {
          String value = "value containing spaces";
          Map<String, Cookie> cookies = cookieParser.parse("name=" + value);
          assertThat(cookies, hasKey("name"));
          assertThat(cookies.get("name").getValue(), is(value));
      }
test_case.class_method_signature: CookieParserTest.shouldParseCookieHavingSpaceInValue()
test_case.full_signature: @Test public void shouldParseCookieHavingSpaceInValue()
test_case.identifier: shouldParseCookieHavingSpaceInValue
test_case.invocations: parse assertThat hasKey assertThat getValue get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldParseCookieHavingSpaceInValue()
focal_class.declarator: VALUE_SEPARATOR = "="
focal_class.modifier: private static final
focal_class.original_string: private static final String VALUE_SEPARATOR = "=";
focal_class.type: String
focal_class.var_name: VALUE_SEPARATOR
focal_class.declarator: COOKIE_SEPARATOR = ";"
focal_class.modifier: private static final
focal_class.original_string: private static final String COOKIE_SEPARATOR = ";";
focal_class.type: String
focal_class.var_name: COOKIE_SEPARATOR
focal_class.file: http/src/main/java/ro/polak/http/protocol/parser/impl/CookieParser.java
focal_class.identifier: CookieParser
focal_class.interfaces: implements Parser<Map<String, Cookie>>
focal_class.class_method_signature: CookieParser.parse(final String input)
focal_class.full_signature: @Override public Map<String, Cookie> parse(final String input)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (final String input)
focal_class.return: Map<String, Cookie>
focal_class.signature: Map<String, Cookie> parse(final String input)
focal_method.body: @Override
      public Map<String, Cookie> parse(final String input) throws MalformedInputException {
          Map<String, Cookie> cookies = new HashMap<>();
  
          // Splitting separate cookies array
          String[] cookiesStr = input.split(COOKIE_SEPARATOR);
          for (int i = 0; i < cookiesStr.length; i++) {
              // Splitting cookie name=value pair
              String[] cookieValues = cookiesStr[i].split(VALUE_SEPARATOR, 2);
              String cookieName = cookieValues[0].trim();
              if (cookieValues.length > 1 && cookieName.length() > 0) {
                  Cookie cookie = new Cookie(cookieName, StringUtilities.urlDecode(cookieValues[1]));
                  cookies.put(cookie.getName(), cookie);
              }
          }
  
          return cookies;
      }
focal_method.class_method_signature: CookieParser.parse(final String input)
focal_method.full_signature: @Override public Map<String, Cookie> parse(final String input)
focal_method.identifier: parse
focal_method.invocations: split split trim length urlDecode put getName
focal_method.modifiers: @Override public
focal_method.parameters: (final String input)
focal_method.return: Map<String, Cookie>
focal_method.signature: Map<String, Cookie> parse(final String input)