class X509TrustManagerWrapper implements X509TrustManager {

    public static TrustManager[] wrap(TrustManager[] trustManagers) {
        TrustManager[] wrappers = new TrustManager[trustManagers.length];

        for (int i = 0; i < trustManagers.length; i++) {
            TrustManager trustManager = trustManagers[i];

            if (trustManager instanceof X509TrustManager) {
                wrappers[i] = new X509TrustManagerWrapper((X509TrustManager) trustManager);
            } else {
                wrappers[i] = trustManager;
            }
        }

        return wrappers;
    }

    public  X509TrustManagerWrapper(final X509TrustManager trustManager);

}