Message implements BodyContent, JsonSerializable { private Message(Builder builder) { this.body = builder.body; this.metadata = builder.metadata != null ? unmodifiableMap(new HashMap<>(builder.metadata)) : null; } private  Message(Builder builder); String getBody(); Map<String, Object> getMetadata(); @Override String getKeyName(); @Override Object asJson(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldBeEqual() { Message message1 = Factory.message(); Message message2 = Factory.message(); assertThat(message2, is(message1)); }