@Override
    public boolean isValidEndPoint(final URL url) {
        try (val response = this.wrappedHttpClient.execute(new HttpGet(url.toURI()))) {
            val responseCode = response.getCode();
            val idx = Collections.binarySearch(this.acceptableCodes, responseCode);
            if (idx >= 0) {
                LOGGER.debug("Response code from server matched [{}].", responseCode);
                return true;
            }

            LOGGER.debug("Response code did not match any of the acceptable response codes. Code returned was [{}]", responseCode);

            if (responseCode == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
                val value = response.getReasonPhrase();
                LOGGER.error("There was an error contacting the endpoint: [{}]; The error was:\n[{}]", url.toExternalForm(), value);
            }

            val entity = response.getEntity();
            try {
                LOGGER.debug("Located entity with length [{}]", entity.getContentLength());
            } finally {
                EntityUtils.consumeQuietly(entity);
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return false;
    }
Implementation of CAS {@link HttpClient}
which delegates requests to a {@link #wrappedHttpClient} instance.

@author Jerome Leleu
@author Scott Battaglia
@author Misagh Moayyed
@since 3.1
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/http/SimpleHttpClient.java