### Question:
DownloadOkHttp3Connection implements DownloadConnection, DownloadConnection.Connected { @Override public Connected execute() throws IOException { request = requestBuilder.build(); response = client.newCall(request).execute(); return this; } 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 public void execute() throws IOException { final Call call = mock(Call.class); when(client.newCall(any(Request.class))).thenReturn(call); final Request request = new Request.Builder() .url("http: .build(); final Response response = createResponseBuilder().build(); when(call.execute()).thenReturn(response); final Request.Builder builder = mock(Request.Builder.class); when(builder.build()).thenReturn(request); DownloadOkHttp3Connection connection = new DownloadOkHttp3Connection(client, builder); connection.execute(); verify(client).newCall(eq(request)); verify(call).execute(); }