private static String getIpAddress(Computer computer) throws RequestUnsuccessfulException, DigitalOceanException { Droplet instance = computer.updateInstanceDescription(); for (final Network network : instance.getNetworks().getVersion4Networks()) { String host = network.getIpAddress(); if (host != null) { return host; } } return null; }