@Test
public void testRemoveHostComponentStateEntity() throws Exception {

  HostEntity hostEntity = new HostEntity();
  HostComponentStateEntity stateEntity = new HostComponentStateEntity();
  hostEntity.setHostComponentStateEntities(new HashSet<HostComponentStateEntity>());
  Collection<HostComponentStateEntity> stateEntities = hostEntity.getHostComponentStateEntities();
  assertTrue(stateEntities.isEmpty());
  hostEntity.addHostComponentStateEntity(stateEntity);
  stateEntities = hostEntity.getHostComponentStateEntities();
  assertTrue(stateEntities.contains(stateEntity));
  hostEntity.removeHostComponentStateEntity(stateEntity);
  stateEntities = hostEntity.getHostComponentStateEntities();
  assertFalse(stateEntities.contains(stateEntity));
}