Instance implements Serializable { @Override public boolean equals( Object obj ) { return obj instanceof Instance && InstanceHelpers.haveSamePath( this, (Instance) obj); } Instance();  Instance( String name ); String getName(); void setName( String name ); synchronized InstanceStatus getStatus(); synchronized void setStatus( InstanceStatus status ); Component getComponent(); void setComponent( Component component ); Instance getParent(); void setParent( Instance parent ); Collection<Instance> getChildren(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); Instance name( String name ); Instance component( Component component ); Instance parent( Instance parent ); Instance channel( String channel ); synchronized Instance status( InstanceStatus status ); Map<String,Collection<Import>> getImports(); static final String IP_ADDRESS; static final String MACHINE_ID; static final String TARGET_ACQUIRED; static final String APPLICATION_NAME; static final String LAST_PROBLEM; static final String READY_FOR_CFG_MARKER; static final String RUNNING_FROM; static final String DELETE_WHEN_NOT_DEPLOYED; final Collection<String> channels; final Map<String,String> overriddenExports; final Map<String,String> data; }
@Test public void testEquals() { Instance hop = new Instance( "hop" ); Assert.assertFalse( hop.equals( null )); Assert.assertFalse( hop.equals( new Instance( "hop2" ))); Assert.assertEquals( hop, hop ); Assert.assertEquals( hop, new Instance ("hop" )); }