VmEntity extends InfrastructureEntity { public void removeIso(IsoEntity iso) { isos.remove(iso); }  @Override String getKind(); List<AttachedDiskEntity> getAttachedDisks(); void setAttachedDisks(List<AttachedDiskEntity> attachedDisks); void removeAttachedDisks(List<AttachedDiskEntity> attachedDisks); void addAttachedDisk(AttachedDiskEntity attachedDisk); void removeAttachedDisk(AttachedDiskEntity attachedDisk); List<LocalityEntity> getAffinities(); void setAffinities(List<LocalityEntity> affinities); List<String> getAffinities(String kind); String getHostAffinity(); Map<String, String> getMetadata(); void setMetadata(Map<String, String> metadata); List<String> getNetworks(); void setNetworks(List<String> networks); String getAgent(); void setAgent(String agent); Map<String, String> getEnvironment(); void setEnvironment(Map<String, String> environment); VmState getState(); void setState(VmState state); String getDefaultGateway(); void setDefaultGateway(String defaultGateway); String getDatastore(); void setDatastore(String datastore); String getDatastoreName(); void setDatastoreName(String datastoreName); String getImageId(); void setImageId(String imageId); String getHost(); void setHost(String host); List<IsoEntity> getIsos(); void setIsos(List<IsoEntity> isos); void addIso(IsoEntity iso); void removeIso(IsoEntity iso); List<Throwable> getWarnings(); void setWarnings(List<Throwable> warnings); void addWarning(Throwable warning); String getFloatingIp(); void setFloatingIp(String floatingIp); void setHasMACAddresses(boolean hasMACAddresses); boolean getHasMACAddresses(); String buildVmFolderPath();  }
@Test public void testRemoveIso() { ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setId("project-1"); vmEntity.setId("vm-id1"); vmEntity.setName("vm-1"); vmEntity.setProjectId(projectEntity.getId()); IsoEntity iso = new IsoEntity(); iso.setId("iso-id"); iso.setName("iso-name"); iso.setSize(new Long(10000)); vmEntity.addIso(iso); assertThat(vmEntity.getIsos().get(0), is(iso)); vmEntity.removeIso(iso); assertThat(vmEntity.getIsos().isEmpty(), is(true)); }