RequestMessage extends AbstractMessage<RequestMessageContext> { @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(super.hashCode()).append(this.getClass()).toHashCode(); } RequestMessage(MessageMetadata messageMetadata); String getOriginalPath(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testHashCode() { RequestMessage req = new RequestMessage(messageMetadata); req.put("a", "b"); ResponseMessage res = new ResponseMessage(req); res.put("a", "b"); assertThat(req.hashCode(), is(not(equalTo(res.hashCode())))); }