public static void closeConnection(final HttpURLConnection connection) {
        if (connection != null) {
            connection.disconnect();
        }
    }
<p>closeConnection.</p>

@param connection a {@link HttpURLConnection} object
pac4j-core/src/main/java/org/pac4j/core/util/HttpUtils.java