ResponseBuilder { public ResponseBuilder<T> withListener(Listener<T> listener) { assertFinishState(); this.listener = listener; return this; } ResponseBuilder(RequestQueue requestQueue, VolleyerConfiguration configuration, HttpContent httpContent, Class<T> clazz); ResponseBuilder<T> withListener(Listener<T> listener); ResponseBuilder<T> withErrorListener(ErrorListener errorListener); ResponseBuilder<T> withResponseParser(NetworkResponseParser responseParser); Request<T> execute();  }
@Test public void withListenerMethodShouldReturnSameInstanceOfBuilder() { String url = "http: HttpMethod method = HttpMethod.GET; HttpContent httpContent = new HttpContent(url, method); VolleyerConfiguration configuration = DefaultVolleyerConfigurationFactory.create(); Class<String> clazz = String.class; ResponseBuilder<String> builder = new ResponseBuilder<String>(requestQueue, configuration, httpContent, clazz); Listener<String> listener = new Listener<String>(){ @Override public void onResponse(String response) { }}; ResponseBuilder<String> newBuilder = builder.withListener(listener); assertTrue(builder == newBuilder); }