GoogleAuth { public static boolean isJwt(String token) { if (token == null) { return false; } return JWT_PATTERN.matcher(token).matches(); }  static String getAuthToken(HttpServletRequest request); static boolean isJwt(String token); static boolean isOAuth2Token(String token); static TokenInfo getTokenInfoRemote(String token);  }
@Test public void testIsJwt() { assertFalse(GoogleAuth.isJwt("ya29.abcdef")); assertFalse(GoogleAuth.isJwt("abcdef.abcdef")); assertFalse(GoogleAuth.isJwt("abc.abcdef.abcdef")); assertFalse(GoogleAuth.isJwt("abcdef.abc.abcdef")); assertFalse(GoogleAuth.isJwt("abcdef.abcdef.abc")); assertFalse(GoogleAuth.isJwt("abcdef.abcdef.abcdef.abcdef")); assertFalse(GoogleAuth.isJwt("abcdef.abcd*ef.abcdef")); assertTrue(GoogleAuth.isJwt("abcdef.abcdef.abcdef")); }