@Test public void serverEquals_Metadata_Equals_Test() { HashMap<String, String> server1Metadata = new HashMap<>(); server1Metadata.put("Hello", "World"); server1Metadata.put("City", "Shanghai"); Server server1 = Server.newBuilder().setServerId("abc").setMetadata(server1Metadata).build(); HashMap<String, String> server2Metadata = new HashMap<>(); server2Metadata.put("Hello", "World"); server2Metadata.put("City", "Shanghai"); Server server2 = Server.newBuilder().setServerId("abc").setMetadata(server2Metadata).build(); Assert.assertEquals(server1, server2); Assert.assertEquals(server2, server1); }
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server();  Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server();  Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Override String toString(); static Builder newBuilder(); @Override int hashCode(); boolean equals(Server other); @Override boolean equals(Object obj); }
Server { public static Builder newBuilder() { return new Builder(); } Server();  Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Override String toString(); static Builder newBuilder(); @Override int hashCode(); boolean equals(Server other); @Override boolean equals(Object obj);  }