private static boolean matches(String match_header,String to_match){
  String[] matchValues=match_header.split("\\s*,\\s*");
  Arrays.sort(matchValues);
  return Arrays.binarySearch(matchValues,to_match) > -1 || Arrays.binarySearch(matchValues,"*") > -1;
}

private static boolean matches ( String match_header , String to_match ) { String [ ] matchValues = match_header . split ( "\\s*,\\s*" ) ; Arrays . sort ( matchValues ) ; return Arrays . binarySearch ( matchValues , to_match ) > - 1 || Arrays . binarySearch ( matchValues , "*" ) > - 1 ; }
returns true if the given match header matches the given value .
