ContainerHostInfoModel extends HostInfoModel implements ContainerHostInfo { @Override public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( !( o instanceof ContainerHostInfoModel ) ) { return false; } final ContainerHostInfoModel that = ( ContainerHostInfoModel ) o; if ( id != null ? !id.equals( that.id ) : that.id != null ) { return false; } return true; } ContainerHostInfoModel( @JsonProperty( "id" ) final String id,
                                   @JsonProperty( "hostname" ) final String hostname,
                                   @JsonProperty( "containerName" ) final String containerName,
                                   @JsonProperty( "interfaces" ) final HostInterfaces hostInterfaces,
                                   @JsonProperty( "arch" ) final HostArchitecture hostArchitecture,
                                   @JsonProperty( "status" ) final ContainerHostState state,
                                   @JsonProperty( "environmentId" ) final String envId,
                                   @JsonProperty( "vlan" ) final Integer vlan );  ContainerHostInfoModel( final ContainerHostInfo info ); @Override Quota getRawQuota(); @Override String getEnvId(); @Override Integer getVlan(); @Override HostInterfaces getHostInterfaces(); void setHostInterfaces( final HostInterfaces hostInterfaces ); @Override ContainerHostState getState(); @Override String getContainerName(); @Override String toString(); @Override int compareTo( final HostInfo o ); @Override boolean equals( final Object o ); @Override int hashCode();  }
@Test public void testEqualsHashCode() throws Exception { ContainerHostInfo containerHostInfo2 = JsonUtil.fromJson( INFO_JSON, ContainerHostInfoModel.class ); assertEquals( containerHostInfo, containerHostInfo2 ); assertFalse( containerHostInfo.equals( new Object() ) ); ContainerHostInfo containerHostInfo3 = JsonUtil.fromJson( INFO2_JSON, ContainerHostInfoModel.class ); assertNotEquals( containerHostInfo, containerHostInfo3 ); Map<ContainerHostInfo, ContainerHostInfo> map = Maps.newHashMap(); map.put( containerHostInfo2, containerHostInfo2 ); assertEquals( containerHostInfo2, map.get( containerHostInfo ) ); }