WalledGardenInternetObservingStrategy implements InternetObservingStrategy { protected HttpsURLConnection createHttpsUrlConnection(final String host, final int port, final int timeoutInMs) throws IOException { URL initialUrl = new URL(host); URL url = new URL(initialUrl.getProtocol(), initialUrl.getHost(), port, initialUrl.getFile()); HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection(); urlConnection.setConnectTimeout(timeoutInMs); urlConnection.setReadTimeout(timeoutInMs); urlConnection.setInstanceFollowRedirects(false); urlConnection.setUseCaches(false); return urlConnection; }  @Override String getDefaultPingHost(); @Override Observable<Boolean> observeInternetConnectivity(final int initialIntervalInMs,
      final int intervalInMs, final String host, final int port, final int timeoutInMs,
      final int httpResponse,
      final ErrorHandler errorHandler); @Override Single<Boolean> checkInternetConnectivity(final String host, final int port,
      final int timeoutInMs, final int httpResponse, final ErrorHandler errorHandler);  }
@Test public void shouldCreateHttpsUrlConnection() throws IOException { final String parsedDefaultHost = "clients3.google.com"; HttpURLConnection connection = strategy.createHttpsUrlConnection("https: assertThat(connection).isNotNull(); assertThat(connection.getURL().getHost()).isEqualTo(parsedDefaultHost); assertThat(connection.getURL().getPort()).isEqualTo(PORT); assertThat(connection.getConnectTimeout()).isEqualTo(TIMEOUT_IN_MS); assertThat(connection.getReadTimeout()).isEqualTo(TIMEOUT_IN_MS); assertThat(connection.getInstanceFollowRedirects()).isFalse(); assertThat(connection.getUseCaches()).isFalse(); }