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 throwsExceptionWhenSecondMediaTypeForCheckingCompatibilityIsNull() {
          MediaTypeHelper.isCompatible(new MediaType(), null);
      }
test_case.class_method_signature: MediaTypeHelperTest.throwsExceptionWhenSecondMediaTypeForCheckingCompatibilityIsNull()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenSecondMediaTypeForCheckingCompatibilityIsNull()
test_case.identifier: throwsExceptionWhenSecondMediaTypeForCheckingCompatibilityIsNull
test_case.invocations: isCompatible
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void throwsExceptionWhenSecondMediaTypeForCheckingCompatibilityIsNull()
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 isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo) {
          if (mediaTypeOne == null || mediaTypeTwo == null) {
              throw new IllegalArgumentException("Null arguments are not allowed");
          }
  
          if (mediaTypeOne.isWildcardType() || mediaTypeTwo.isWildcardType()) {
              return true;
          }
  
          if (mediaTypeOne.getType().equalsIgnoreCase(mediaTypeTwo.getType())) {
  
              if (mediaTypeOne.isWildcardSubtype()
                  || mediaTypeTwo.isWildcardSubtype()
                  || mediaTypeOne.getSubtype().equalsIgnoreCase(mediaTypeTwo.getSubtype())) {
  
                  return true;
              }
  
              Matcher extSubtypeMatcherOne = EXT_SUBTYPE_PATTERN.matcher(mediaTypeOne.getSubtype());
              Matcher extSubtypeMatcherTwo = EXT_SUBTYPE_PATTERN.matcher(mediaTypeTwo.getSubtype());
              boolean extSubtypeMatcherOneMatches = extSubtypeMatcherOne.matches();
              boolean extSubtypeMatcherTwoMatches = extSubtypeMatcherTwo.matches();
  
              if (!extSubtypeMatcherOneMatches && extSubtypeMatcherTwoMatches) {
  
                  // one is type such as application/xml
                  // two is type such as application/atom+xml, application/*+xml, application/xml+*
                  return mediaTypeOne.getSubtype().equalsIgnoreCase(extSubtypeMatcherTwo.group(1))
                         || mediaTypeOne.getSubtype().equalsIgnoreCase(extSubtypeMatcherTwo.group(2));
  
              } else if (extSubtypeMatcherOneMatches && !extSubtypeMatcherTwoMatches) {
  
                  // one is type such as application/atom+xml, application/*+xml, application/xml+*
                  // two is type such as application/xml
                  return mediaTypeTwo.getSubtype().equalsIgnoreCase(extSubtypeMatcherOne.group(1))
                         || mediaTypeTwo.getSubtype().equalsIgnoreCase(extSubtypeMatcherOne.group(2));
  
              } else if (extSubtypeMatcherOneMatches && extSubtypeMatcherTwoMatches) {
  
                  // both types are extended types
                  String subtypePrefixOne = extSubtypeMatcherOne.group(1);
                  String subTypeSuffixOne = extSubtypeMatcherOne.group(2);
                  String subTypePrefixTwo = extSubtypeMatcherTwo.group(1);
                  String subtypeSuffixTwo = extSubtypeMatcherTwo.group(2);
  
                  if (subtypePrefixOne.equalsIgnoreCase(subTypePrefixTwo)
                      && (MEDIA_TYPE_WILDCARD.equals(subTypeSuffixOne) || MEDIA_TYPE_WILDCARD.equals(subtypeSuffixTwo))) {
                      // parts before '+' are the same and one of after '+' is wildcard '*'
                      // For example two sub-types: atom+* and atom+xml
                      return true;
                  }
                  if (subTypeSuffixOne.equalsIgnoreCase(subtypeSuffixTwo)
                      && (MEDIA_TYPE_WILDCARD.equals(subtypePrefixOne) || MEDIA_TYPE_WILDCARD.equals(subTypePrefixTwo))) {
                      // parts after '+' are the same and one of before '+' is wildcard '*'
                      // For example two sub-types: *+xml and atom+xml
                      return true;
                  }
              }
          }
          return false;
      }
focal_method.class_method_signature: MediaTypeHelper.isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_method.full_signature: public static boolean isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_method.identifier: isCompatible
focal_method.invocations: isWildcardType isWildcardType equalsIgnoreCase getType getType isWildcardSubtype isWildcardSubtype equalsIgnoreCase getSubtype getSubtype matcher getSubtype matcher getSubtype matches matches equalsIgnoreCase getSubtype group equalsIgnoreCase getSubtype group equalsIgnoreCase getSubtype group equalsIgnoreCase getSubtype group group group group group equalsIgnoreCase equals equals equalsIgnoreCase equals equals
focal_method.modifiers: public static
focal_method.parameters: (MediaType mediaTypeOne, MediaType mediaTypeTwo)
focal_method.return: boolean
focal_method.signature: boolean isCompatible(MediaType mediaTypeOne, MediaType mediaTypeTwo)