}
@Test
public void testChainBuildRestResponseFromResponseBuilder()
{
final Response res = new RestResponseBuilder()
.setEntity(new byte[] {1,2,3,4})
.setHeader("k1", "v1")
.setStatus(300)
.build()
.responseBuilder()
.setEntity(new byte[] {5,6,7,8})
.build();
Assert.assertEquals(new byte[] {5,6,7,8}, res.getEntity().copyBytes());
Assert.assertTrue(res instanceof RestResponse);
final RestResponse restRes = (RestResponse)res;
Assert.assertEquals("v1", restRes.getHeader("k1"));
Assert.assertEquals(300, restRes.getStatus());