Code example for MapMaker

0
     * Creates a new, empty ConcurrentHashSet.  
     */ 
    public ConcurrentHashSet() { 
    	// had some really weird NPEs with Java's ConcurrentHashMap (i.e. got a 
    	// NPE at size()), now trying witrh Guava instead 
        delegate = new MapMaker().concurrencyLevel
        		(Runtime.getRuntime().availableProcessors()).makeMap();
    } 
 
    @Override 
    public int size() { 
        return delegate.size();
    } 
 
    @Override 
    public boolean contains(Object o) { 
        return delegate.containsKey(o);
    } 
 
    @Override 
Connect your IDE to all the code out there  Get Codota for Java