ResponseBuilder { public ResponseBuilder<T> withErrorListener(ErrorListener errorListener) { assertFinishState(); this.errorListener = errorListener; 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 withErrorListenerMethodShouldReturnSameInstanceOfBuilder() { 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); ErrorListener errorListener = new ErrorListener (){ @Override public void onErrorResponse(VolleyError error) { }}; ResponseBuilder<String> newBuilder = builder.withErrorListener(errorListener); assertTrue(builder == newBuilder); }