Server implements JsonSerializable { private Server(Builder builder) { this.host = builder.host; this.root = builder.root; this.branch = builder.branch; this.codeVersion = builder.codeVersion; this.metadata = builder.metadata != null ? unmodifiableMap(new HashMap<>(builder.metadata)) : null; } private  Server(Builder builder); String getHost(); String getRoot(); String getBranch(); String getCodeVersion(); Map<String, Object> getMetadata(); @Override Map<String, Object> asJson(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldBeEqual() { Server server1 = server(); Server server2 = server(); assertThat(server2, is(server1)); }