DelegatingResponse implements Response { public <T> T to(Class<T> type) throws Exception { return delegate.<T>to(type); } DelegatingResponse(Response delegate); Request getRequest(); int getStatusCode(); String getContentType(); Charset getCharset(); String getContentEncoding(); Type getExpectedGenericType(); Class<?> getExpectedType(); T deserialize(); T to(Class<T> type); T to(Class<T> type, Type genericType); InputStream asStream(); void dispose();  }
@Test public void toWithClassShouldDelegates() throws Exception { when(mockResponse.to(Object.class)).thenReturn(10); assertEquals(10, toTest.to(Object.class)); }
@Test public void toWithClassAndTypeShouldDelegates() throws Exception { when(mockResponse.to(Object.class,(Type)Object.class)).thenReturn(10); assertEquals(10, toTest.to(Object.class, (Type)Object.class)); }