for (String zoneId : api.getConfiguredZones()) {
Optional<? extends FloatingIPApi> apiOption = api.getFloatingIPExtensionForZone(zoneId);
if (!apiOption.isPresent())
continue;
FloatingIPApi api = apiOption.get();
FloatingIP floatingIP = api.create();
assertNotNull(floatingIP);
Set<? extends FloatingIP> response = api.list().toSet();
boolean ipInSet = false;
for (FloatingIP ip : response) {
if (ip.getId().equals(floatingIP.getId()))
ipInSet = true;
}
assertTrue(ipInSet);
api.delete(floatingIP.getId());
response = api.list().toSet();
ipInSet = false;
for (FloatingIP ip : response) {
if (ip.getId().equals(floatingIP.getId())) {
ipInSet = true;
}
}
assertFalse(ipInSet);
}