### Question:
HttpClientImpl implements OktaHttpClient { @Override public InputStream connect(@NonNull Uri uri, @NonNull ConnectionParameters params) throws Exception { mUrlConnection = openConnection(new URL(uri.toString()), params); mUrlConnection.connect(); try { return mUrlConnection.getInputStream(); } catch (IOException e) { return mUrlConnection.getErrorStream(); } }  @Override InputStream connect(@NonNull Uri uri, @NonNull ConnectionParameters params); @Override void cleanUp(); @Override void cancel(); @Override Map<String, List<String>> getHeaderFields(); @Override String getHeader(String header); @Override int getResponseCode(); @Override int getContentLength(); @Override String getResponseMessage(); @VisibleForTesting HttpURLConnection getUrlConnection();  }### Answer:
@Test public void connect() throws Exception { mEndPoint.enqueueUserInfoSuccess(); InputStream stream = mHttpClient.connect(Uri.parse(mEndPoint.getUrl()), mRequest.mConnParams); HttpResponse response = new HttpResponse( mHttpClient.getResponseCode(), mHttpClient.getHeaderFields(), mHttpClient.getContentLength(), stream, mHttpClient); JSONObject result = response.asJson(); assertEquals("John Doe", result.get("name")); assertEquals("Jimmy", result.get("nickname")); }