ResourceHostInfoModel extends HostInfoModel implements ResourceHostInfo { @JsonIgnore @Override public Set<ContainerHostInfo> getContainers() { Set<ContainerHostInfo> result = Sets.newHashSet(); if ( !CollectionUtil.isCollectionEmpty( containers ) ) { result.addAll( containers ); } return result; } 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 testGetContainers() throws Exception { Set<ContainerHostInfo> info = resourceHostInfo.getContainers(); assertFalse( info.isEmpty() ); ContainerHostInfo containerHostInfo = info.iterator().next(); assertEquals( CONTAINER_HOSTNAME, containerHostInfo.getHostname() ); assertEquals( CONTAINER_ID, containerHostInfo.getId() ); assertEquals( CONTAINER_STATUS, containerHostInfo.getState() ); }