HeaderHelper { static int isToken(String token) { for (int i = 0; i < token.length(); i++) { char c = token.charAt(i); if (c > 127 || SEPARATORS[c]) { return i; } } return -1; } private  HeaderHelper(); static List<AcceptMediaType> createAcceptMediaTypeList(String header); static List<AcceptLanguage> createAcceptedLanguageList(String header); static List<AcceptToken> createAcceptedCharsetList(String header); static List<AcceptToken> createAcceptedEncodingList(String header); static List<Cookie> parseCookies(String cookiesString); static NewCookie parseNewCookie(String newCookieString); static Date parseDateHeader(String header); static String formatDate(Date date); static long getContentLengthLong(MultivaluedMap<String, String> httpHeaders); @SuppressWarnings({"unchecked"}) static String getHeaderAsString(Object o); static String convertToString(Collection<String> collection); static final Comparator<QualityValue> QUALITY_VALUE_COMPARATOR; }
@UseDataProvider("forChecksIsStringToken") @Test public void checksIsStringToken(String checkIsToken, int indexOfFirstInvalidChar) throws Exception { assertEquals(indexOfFirstInvalidChar, HeaderHelper.isToken(checkIsToken)); }