public static boolean isJWT(String data){
  String[] base64=data.split("\\.");
  boolean val=false;
  try {
    val=isBase64Encoded(base64[0]) && isBase64Encoded(base64[1]) && isBase64Encoded(base64[2]);
  }
 catch (  IndexOutOfBoundsException e) {
    return false;
  }
  return val;
}

public static boolean isJWT ( String data ) { String [ ] base64 = data . split ( "\\." ) ; boolean val = false ; try { val = isBase64Encoded ( base64 [ 0 ] ) && isBase64Encoded ( base64 [ 1 ] ) && isBase64Encoded ( base64 [ 2 ] ) ; } catch ( IndexOutOfBoundsException e ) { return false ; } return val ; }
check if the input is a json web token ( jwt )
