DatabusServerCoordinates implements Comparable<DatabusServerCoordinates> { @Override public boolean equals(Object o) { if ( this == o) return true; if ( o == null) return false; if (getClass() != o.getClass()) return false; final DatabusServerCoordinates castedObj = (DatabusServerCoordinates) o; if ( _address.equals(castedObj.getAddress()) && _state.equals(castedObj.getState()) ) return true; else return false; } DatabusServerCoordinates(String name, InetSocketAddress address, String state);  DatabusServerCoordinates(String name, InetSocketAddress address, StateId state);  DatabusServerCoordinates(String name, InetSocketAddress address);  DatabusServerCoordinates(InetSocketAddress address, String state); String getName(); InetSocketAddress getAddress(); void setState(StateId state); StateId getState(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(DatabusServerCoordinates o); boolean isOnlineState(); @Override String toString();  }
@Test public void testUnequalDatabusServerCoordinates() { InetSocketAddress ia1 = new InetSocketAddress("localhost", 9001); InetSocketAddress ia2 = new InetSocketAddress("localhost", 9002); DatabusServerCoordinates rc1 = new DatabusServerCoordinates("DatabusServerCoordinates1", ia1, "ONLINE"); DatabusServerCoordinates rc2 = new DatabusServerCoordinates("DatabusServerCoordinates1", ia2, "ONLINE"); assertEquals(rc1.equals(rc2), false); }
@Test public void testUnequalDatabusServerCoordinates2() { InetSocketAddress ia1 = new InetSocketAddress("localhost", 9001); DatabusServerCoordinates rc1 = new DatabusServerCoordinates("DatabusServerCoordinates1", ia1, "ONLINE"); DatabusServerCoordinates rc2 = new DatabusServerCoordinates("DatabusServerCoordinates1", ia1, "OFFLINE"); assertEquals(rc1.equals(rc2), false); }