try {
ip = connection.allocateAddressInLocation(location.getId(), offering.getId());
System.out.println(ip);
assertEquals(ip.getIP(), null);
// wait up to 30 seconds for this to become "free"
new RetryablePredicate<Address>(new AddressFree(connection), 30, 2, TimeUnit.SECONDS).apply(ip);
refreshIpAndReturnAllAddresses();
assertEquals(ip.getInstanceId(), null);
} catch (IllegalStateException e) {
if (HttpResponseException.class.cast(e.getCause()).getResponse().getStatusCode() == 409) {
ip = Iterables.find(connection.listAddresses(), new Predicate<Address>() {