package cz.jiripinkas.jsitemapgenerator;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class HttpClient {

    /**
     * HTTP GET to URL, return status
     *
     * @param url URL
     * @return status code (for example 200)
     * @throws Exception When error
     */
    public int get(String url) throws Exception {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                .url(url)
                .build();
        try (Response response = client.newCall(request).execute()) {
            if (!response.isSuccessful()) {
                throw new Exception("error sending HTTP GET to this URL: " + url);
            }
            return response.code();
        }
    }
}

@@ -748,24 +748,233 @@
 nse.code();%0A
+        %7D finally %7B%0A            // this will be executed after %22return response.code();%22%0A            client.connectionPool().evictAll(); // OkHttpClient starts connection pool which needs to be shut down here%0A
         %7D%0A  

Fix ping google / bing functionality so that OkHttp cleans up all resources after itself.