code: public Collection<String> getCandidateEIPs(String myInstanceId, String myZone) {
  
          if (myZone == null) {
              myZone = "us-east-1d";
          }
  
          Collection<String> eipCandidates = clientConfig.shouldUseDnsForFetchingServiceUrls()
                          ? getEIPsForZoneFromDNS(myZone)
                          : getEIPsForZoneFromConfig(myZone);
  
          if (eipCandidates == null || eipCandidates.size() == 0) {
              throw new RuntimeException("Could not get any elastic ips from the EIP pool for zone :" + myZone);
          }
  
          return eipCandidates;
      }
docs: Get the list of EIPs in the order of preference depending on instance zone.
  
  @param myInstanceId
  the instance id for this instance
  @param myZone
  the zone where this instance is in
  @return Collection containing the list of available EIPs