Person implements JsonSerializable { private Person(Builder builder) { this.id = builder.id; this.username = builder.username; this.email = builder.email; this.metadata = builder.metadata != null ? unmodifiableMap(new HashMap<>(builder.metadata)) : null; } private  Person(Builder builder); String getId(); String getUsername(); String getEmail(); Map<String, Object> getMetadata(); @Override Map<String, Object> asJson(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldBeEqual() { Person person1 = person(); Person person2 = person(); assertThat(person2, is(person1)); }