### Question:
DownloadOkHttp3Connection implements DownloadConnection, DownloadConnection.Connected { @Override public int getResponseCode() throws IOException { if (response == null) throw new IOException("Please invoke execute first!"); return response.code(); } DownloadOkHttp3Connection(@NonNull OkHttpClient client,
                              @NonNull Request.Builder requestBuilder);   DownloadOkHttp3Connection(@NonNull OkHttpClient client, @NonNull String url); @Override void addHeader(String name, String value); @Override Connected execute(); @Override void release(); @Override Map<String, List<String>> getRequestProperties(); @Override String getRequestProperty(String key); @Override int getResponseCode(); @Override InputStream getInputStream(); @Override boolean setRequestMethod(@NonNull String method); @Override Map<String, List<String>> getResponseHeaderFields(); @Override String getResponseHeaderField(String name); @Override String getRedirectLocation();  }### Answer:
@Test(expected = IOException.class) public void getResponseCode_responseIsNull_throwException() throws IOException { connection.getResponseCode(); }