Response { public boolean eq(Response that) { return this.code.eq(that.code) && eqHeader(this.header, that.header) && this.representation.eq(that.representation); } Response(ResponseCode code, Representation r, HeaderField ... header); boolean hasRepresentation(); Representation representation(); ResponseCode code(); HeaderField[] header(); String show(); boolean eq(Response that);  }
@Test public void eqTest() throws Exception { Response res1 = OK(Text("body"), new GenericHeaderField("foocience", "foo"), new GenericHeaderField("bariness", "bar")); Response res2 = OK(Text("body"), new GenericHeaderField("foocience", "foo"), new GenericHeaderField("bariness", "bar")); Response res3 = OK(Text("doby"), new GenericHeaderField("foocience", "fuzz"), new GenericHeaderField("bariness", "barre")); assertEquals(true, res1.eq(res1)); assertEquals(true, res1.eq(res2)); assertEquals(false, res1.eq(res3)); }