ResourceHostInfoModel extends HostInfoModel implements ResourceHostInfo { @Override public int compareTo( final HostInfo o ) { if ( hostname != null && o != null ) { return hostname.compareTo( o.getHostname() ); } return -1; } ResourceHostInfoModel( final ResourceHostInfo resourceHostInfo ); long getDateCreated(); void setDateCreated( final long dateCreated ); @Override String getAddress(); @Override String getId(); @Override String getHostname(); @Override @JsonIgnore InstanceType getInstanceType(); @JsonIgnore Set<Alert> getAlerts(); @JsonIgnore @Override Set<ContainerHostInfo> getContainers(); @Override String toString(); @Override int compareTo( final HostInfo o ); @Override boolean equals( final Object o ); @Override int hashCode();  }
@Test public void testCompare() throws Exception { assertEquals( -1, resourceHostInfo.compareTo( null ) ); ResourceHostInfo resourceHostInfo2 = JsonUtil.fromJson( INFO_JSON, ResourceHostInfoModel.class ); assertEquals( 0, resourceHostInfo.compareTo( resourceHostInfo2 ) ); }