Set<Image> images = existingImage == null ? ImmutableSet.<Image> of() : ImmutableSet.of(existingImage);
Set<Hardware> hardwares = existingHardware == null ? ImmutableSet.<Hardware> of() : ImmutableSet
.of(existingHardware);
Server serverToConvert = new ParseServerTest().expected();
ServerInZone serverInZoneToConvert = new ServerInZone(serverToConvert, "az-1.region-a.geo-1");
ServerInZoneToNodeMetadata converter = new ServerInZoneToNodeMetadata(
NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
.<Set<? extends Image>> ofInstance(images), Suppliers
.<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);
NodeMetadata convertedNodeMetadata = converter.apply(serverInZoneToConvert);
assertEquals(serverInZoneToConvert.slashEncode(), convertedNodeMetadata.getId());
assertEquals(serverToConvert.getId(), convertedNodeMetadata.getProviderId());
assertEquals(convertedNodeMetadata.getLocation().getScope(), LocationScope.HOST);
assertEquals(convertedNodeMetadata.getLocation().getId(), "e4d909c290d0fb1ca068ffaddf22cbd0");