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;
    }
@Test
    public void shouldFilterNonElasticNamesInOtherRegion() {
        when(config.getRegion()).thenReturn("eu-west-1");
        List<String> hosts = Lists.newArrayList("example.com", "ec2-1-2-3-4.eu-west-1.compute.amazonaws.com",
                "5.6.7.8", "ec2-101-202-33-44.eu-west-1.compute.amazonaws.com");
        when(config.getEurekaServerServiceUrls(any(String.class))).thenReturn(hosts);

        Collection<String> returnValue = eipManager.getCandidateEIPs("i-123", "eu-west-1a");
        assertEquals(2, returnValue.size());
        assertTrue(returnValue.contains("1.2.3.4"));
        assertTrue(returnValue.contains("101.202.33.44"));
    }