SentinelHello { @Override public boolean equals(Object obj) { if (!(obj instanceof SentinelHello)) { return false; } SentinelHello other = (SentinelHello) obj; if (!ObjectUtils.equals(sentinelAddr, other.sentinelAddr)) { return false; } if (!ObjectUtils.equals(monitorName, other.monitorName)) { return false; } if (!ObjectUtils.equals(masterAddr, other.masterAddr)) { return false; } return true; } SentinelHello();  SentinelHello(HostPort sentinelAddr, HostPort masterAddr, String monitorName); static SentinelHello fromString(String helloStr); HostPort getSentinelAddr(); HostPort getMasterAddr(); String getMonitorName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals(){ SentinelHello sentinelHello1 = SentinelHello.fromString("10.15.95.133,33322," + "642d5452b3ffd243fdfc31a2ccf5b0b5963c161f,1942," + "FlightIntlGDSCacheGroup1," + "10.15.94.178,6379,0"); SentinelHello sentinelHello2 = SentinelHello.fromString("10.15.95.133,33322," + "642d5452b3ffd243fdfc31a2ccf5b0b5963c161f_XXX,1942abc," + "FlightIntlGDSCacheGroup1," + "10.15.94.178,6379,0"); Assert.assertEquals(sentinelHello1, sentinelHello2); }