private HiveConnection getConnection(String jwt, Boolean putJwtInEnv) throws Exception {
    String url = getJwtJdbcConnectionUrl();
    if (jwt != null && putJwtInEnv) {
      System.getenv().put(Utils.JdbcConnectionParams.AUTH_JWT_ENV, jwt);
    } else if (jwt != null) {
      url += "jwt=" + jwt;
    }
    Class.forName("org.apache.hive.jdbc.HiveDriver");
    Connection connection = DriverManager.getConnection(url, null, null);
    return (HiveConnection) connection;
  }
This is a hack to make environment variables modifiable.
Ref: https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java.
itests/hive-unit/src/test/java/org/apache/hive/service/auth/jwt/TestHttpJwtAuthentication.java