test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/header/MediaTypeHelperTest.java
test_class.identifier: MediaTypeHelperTest
test_case.body: @Test(expected = IllegalArgumentException.class)
      public void throwsExceptionWhenSecondMediaTypeForMatchingIsNull() {
          MediaTypeHelper.isMatched(new MediaType(), null);
      }
test_case.class_method_signature: MediaTypeHelperTest.throwsExceptionWhenSecondMediaTypeForMatchingIsNull()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenSecondMediaTypeForMatchingIsNull()
test_case.identifier: throwsExceptionWhenSecondMediaTypeForMatchingIsNull
test_case.invocations: isMatched
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void throwsExceptionWhenSecondMediaTypeForMatchingIsNull()
focal_class.declarator: DEFAULT_TYPE_LIST = Collections.singletonList(MediaType.WILDCARD_TYPE)
focal_class.modifier: private static final
focal_class.original_string: private static final List<MediaType> DEFAULT_TYPE_LIST = Collections.singletonList(MediaType.WILDCARD_TYPE);
focal_class.type: List<MediaType>
focal_class.var_name: DEFAULT_TYPE_LIST
focal_class.declarator: WADL_TYPE = new MediaType("application", "vnd.sun.wadl+xml")
focal_class.modifier: public static final
focal_class.original_string: public static final MediaType WADL_TYPE = new MediaType("application", "vnd.sun.wadl+xml");
focal_class.type: MediaType
focal_class.var_name: WADL_TYPE
focal_class.declarator: EXT_PREFIX_SUBTYPE = "*+"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXT_PREFIX_SUBTYPE = "*+";
focal_class.type: String
focal_class.var_name: EXT_PREFIX_SUBTYPE
focal_class.declarator: EXT_SUBTYPE_PATTERN = Pattern.compile("([^\\+]+)\\+(.+)")
focal_class.modifier: public static final
focal_class.original_string: public static final Pattern EXT_SUBTYPE_PATTERN = Pattern.compile("([^\\+]+)\\+(.+)");
focal_class.type: Pattern
focal_class.var_name: EXT_SUBTYPE_PATTERN
focal_class.declarator: EXT_SUFFIX_SUBTYPE_PATTERN = Pattern.compile("([^\\+]+)\\+\\*")
focal_class.modifier: public static final
focal_class.original_string: public static final Pattern EXT_SUFFIX_SUBTYPE_PATTERN = Pattern.compile("([^\\+]+)\\+\\*");
focal_class.type: Pattern
focal_class.var_name: EXT_SUFFIX_SUBTYPE_PATTERN
focal_class.declarator: EXT_PREFIX_SUBTYPE_PATTERN = Pattern.compile("\\*\\+(.+)")
focal_class.modifier: public static final
focal_class.original_string: public static final Pattern EXT_PREFIX_SUBTYPE_PATTERN = Pattern.compile("\\*\\+(.+)");
focal_class.type: Pattern
focal_class.var_name: EXT_PREFIX_SUBTYPE_PATTERN
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/header/MediaTypeHelper.java
focal_class.identifier: MediaTypeHelper
focal_class.class_method_signature: MediaTypeHelper.createDescendingMediaTypeIterator(MediaType type)
focal_class.full_signature: public static Iterator<MediaType> createDescendingMediaTypeIterator(MediaType type)
focal_class.identifier: createDescendingMediaTypeIterator
focal_class.modifiers: public static
focal_class.parameters: (MediaType type)
focal_class.return: Iterator<MediaType>
focal_class.signature: Iterator<MediaType> createDescendingMediaTypeIterator(MediaType type)
focal_class.class_method_signature: MediaTypeHelper.createConsumesList(Consumes mime)
focal_class.full_signature: public static List<MediaType> createConsumesList(Consumes mime)
focal_class.identifier: createConsumesList
focal_class.modifiers: public static
focal_class.parameters: (Consumes mime)
focal_class.return: List<MediaType>
focal_class.signature: List<MediaType> createConsumesList(Consumes mime)
focal_class.class_method_signature: MediaTypeHelper.createProducesList(Produces mime)
focal_class.full_signature: public static List<MediaType> createProducesList(Produces mime)
focal_class.identifier: createProducesList
focal_class.modifiers: public static
focal_class.parameters: (Produces mime)
focal_class.return: List<MediaType>
focal_class.signature: List<MediaType> createProducesList(Produces mime)
focal_class.class_method_signature: MediaTypeHelper.isConsume(List<MediaType> consumes, MediaType contentType)
focal_class.full_signature: public static boolean isConsume(List<MediaType> consumes, MediaType contentType)
focal_class.identifier: isConsume
focal_class.modifiers: public static
focal_class.parameters: (List<MediaType> consumes, MediaType contentType)
focal_class.return: boolean
focal_class.signature: boolean isConsume(List<MediaType> consumes, MediaType contentType)
focal_class.class_method_signature: MediaTypeHelper.createMediaTypesList(String[] mimes)
focal_class.full_signature: private static List<MediaType> createMediaTypesList(String[] mimes)
focal_class.identifier: createMediaTypesList
focal_class.modifiers: private static
focal_class.parameters: (String[] mimes)
focal_class.return: List<MediaType>
focal_class.signature: List<MediaType> createMediaTypesList(String[] mimes)
focal_class.class_method_signature: MediaTypeHelper.findFistCompatibleAcceptMediaType(List<AcceptMediaType> acceptMediaTypes,
                                                                      List<MediaType> producedByResource)
focal_class.full_signature: public static AcceptMediaType findFistCompatibleAcceptMediaType(List<AcceptMediaType> acceptMediaTypes,
                                                                      List<MediaType> producedByResource)
focal_class.identifier: findFistCompatibleAcceptMediaType
focal_class.modifiers: public static
focal_class.parameters: (List<AcceptMediaType> acceptMediaTypes,
                                                                      List<MediaType> producedByResource)
focal_class.return: AcceptMediaType
focal_class.signature: AcceptMediaType findFistCompatibleAcceptMediaType(List<AcceptMediaType> acceptMediaTypes,
                                                                      List<MediaType> producedByResource)
focal_class.class_method_signature: MediaTypeHelper.isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_class.full_signature: public static boolean isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_class.identifier: isCompatible
focal_class.modifiers: public static
focal_class.parameters: (MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_class.return: boolean
focal_class.signature: boolean isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_class.class_method_signature: MediaTypeHelper.isMatched(MediaType pattern, MediaType checkMe)
focal_class.full_signature: public static boolean isMatched(MediaType pattern, MediaType checkMe)
focal_class.identifier: isMatched
focal_class.modifiers: public static
focal_class.parameters: (MediaType pattern, MediaType checkMe)
focal_class.return: boolean
focal_class.signature: boolean isMatched(MediaType pattern, MediaType checkMe)
focal_class.class_method_signature: MediaTypeHelper.MediaTypeHelper()
focal_class.full_signature: private  MediaTypeHelper()
focal_class.identifier: MediaTypeHelper
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  MediaTypeHelper()
focal_method.body: public static boolean isMatched(MediaType pattern, MediaType checkMe) {
          if (pattern == null || checkMe == null) {
              throw new IllegalArgumentException("Null arguments are not allowed");
          }
  
          if (pattern.isWildcardType()) {
              return true;
          }
  
          if (pattern.getType().equalsIgnoreCase(checkMe.getType())) {
              if (pattern.isWildcardSubtype() || pattern.getSubtype().equalsIgnoreCase(checkMe.getSubtype())) {
                  return true;
              }
  
              Matcher patternMatcher = EXT_SUBTYPE_PATTERN.matcher(pattern.getSubtype());
              Matcher checkMeMatcher = EXT_SUBTYPE_PATTERN.matcher(checkMe.getSubtype());
  
              if (patternMatcher.matches()) {
                  String patternPrefix = patternMatcher.group(1);
                  String patternSuffix = patternMatcher.group(2);
  
                  if (!checkMeMatcher.matches()) {
                      // pattern is type such as application/atom+xml, application/*+xml, application/xml+*
                      // checkMe is type such as application/xml
                      return checkMe.getSubtype().equalsIgnoreCase(patternPrefix)
                             || checkMe.getSubtype().equalsIgnoreCase(patternSuffix);
                  }
  
                  // both types are extended types
                  String checkMePrefix = checkMeMatcher.group(1);
                  String checkMeSuffix = checkMeMatcher.group(2);
  
                  if (MEDIA_TYPE_WILDCARD.equals(patternSuffix) && patternPrefix.equalsIgnoreCase(checkMePrefix)) {
                      // parts before '+' are the same and pattern after '+' is wildcard '*'
                      // For example two sub-types: atom+* and atom+xml
                      return true;
                  }
  
                  if (MEDIA_TYPE_WILDCARD.equals(patternPrefix) && patternSuffix.equalsIgnoreCase(checkMeSuffix)) {
                      // parts after '+' are the same and pattern before '+' is wildcard '*'
                      // For example two sub-types: *+xml and atom+xml
                      return true;
                  }
              }
          }
  
          return false;
      }
focal_method.class_method_signature: MediaTypeHelper.isMatched(MediaType pattern, MediaType checkMe)
focal_method.full_signature: public static boolean isMatched(MediaType pattern, MediaType checkMe)
focal_method.identifier: isMatched
focal_method.invocations: isWildcardType equalsIgnoreCase getType getType isWildcardSubtype equalsIgnoreCase getSubtype getSubtype matcher getSubtype matcher getSubtype matches group group matches equalsIgnoreCase getSubtype equalsIgnoreCase getSubtype group group equals equalsIgnoreCase equals equalsIgnoreCase
focal_method.modifiers: public static
focal_method.parameters: (MediaType pattern, MediaType checkMe)
focal_method.return: boolean
focal_method.signature: boolean isMatched(MediaType pattern, MediaType checkMe)