package com.kryptnostic.rhizome.hazelcast.objects;

import java.util.Collection;
import java.util.HashSet;
import java.util.UUID;

public class UUIDSet extends HashSet<UUID> {
    private static final long serialVersionUID = 6290405515755142889L;

    public UUIDSet( Collection<UUID> c ) {
        super( c );
    }

    public UUIDSet( int initialCapacity ) {
        super( initialCapacity );
    }

    public UUIDSet() {
        super();
    }

    public static UUIDSet of( UUID uuid ) {
        UUIDSet us = new UUIDSet( 1 );
        us.add( uuid );
        return us;
    }
}

@@ -124,16 +124,59 @@
 .UUID;%0A%0A
+import com.google.common.primitives.Ints;%0A%0A
 public c
@@ -412,16 +412,30 @@
   super(
+ expectedSize(
  initial
@@ -442,16 +442,18 @@
 Capacity
+ )
  );%0A    
@@ -494,32 +494,481 @@
 super();%0A    %7D%0A%0A
+    public static int expectedSize( int expectedSize ) %7B%0A        if ( expectedSize %3C 0 ) %7B%0A            throw new IllegalArgumentException( %22expectedSize cannot be negative but was: %22 + expectedSize );%0A        %7D%0A        if ( expectedSize %3C 3 ) %7B%0A            return expectedSize + 1;%0A        %7D%0A        if ( expectedSize %3C Ints.MAX_POWER_OF_TWO ) %7B%0A            return expectedSize + expectedSize / 3;%0A        %7D%0A        return Integer.MAX_VALUE;%0A    %7D%0A%0A
     public stati

update uuidset to use some heuristics for sizing sets