Code example for HashSet

Methods: size

0
        assert strategy.getReplicationFactor("DC2") == 2;
        assert strategy.getReplicationFactor("DC3") == 1;
        // Query for the natural hosts 
        ArrayList<InetAddress> endpoints = strategy.getNaturalEndpoints(new StringToken("123"));
        assert 6 == endpoints.size();
        assert 6 == new HashSet<InetAddress>(endpoints).size(); // ensure uniqueness
    } 
 
    @Test 
    public void testPropertiesWithEmptyDC() throws IOException, ParserConfigurationException, SAXException, ConfigurationException 
    { 
        IEndpointSnitch snitch = new PropertyFileSnitch();
        TokenMetadata metadata = new TokenMetadata();
        createDummyTokens(metadata, false);
 
        Map<String, String> configOptions = new HashMap<String, String>();
        configOptions.put("DC1", "3");
        configOptions.put("DC2", "3");
        configOptions.put("DC3", "0");
 
        // Set the localhost to the tokenmetadata. Embedded cassandra way?