RequestMessage extends AbstractMessage<RequestMessageContext> { @Override public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof RequestMessage)) return false; return super.equals(obj); } RequestMessage(MessageMetadata messageMetadata); String getOriginalPath(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() { RequestMessage req = new RequestMessage(messageMetadata); req.put("a", "b"); ResponseMessage res = new ResponseMessage(req); res.put("a", "b"); assertThat(req.equals(res), is(false)); }