package com.lambdaworks;

import java.util.*;

import org.apache.commons.lang3.RandomStringUtils;

/**
 * Random keys for testing slot-hashes.
 * 
 * @author Mark Paluch
 */
public class RandomKeys {

    /**
     * Ordered list of random keys. The order corresponds with the list of {@code VALUES}.
     */
    public static final List<String> KEYS;

    /**
     * Ordered list of random values. The order corresponds with the list of {@code KEYS}.
     */
    public static final List<String> VALUES;

    /**
     * Mapping between {@code KEYS} and {@code VALUES}
     */
    public static final Map<String, String> MAP;

    /**
     * Number of entries.
     */
    public final static int COUNT = 500;

    static {

        List<String> keys = new ArrayList<>();
        List<String> values = new ArrayList<>();
        Map<String, String> map = new HashMap<>();

        for (int i = 0; i < COUNT; i++) {

            String key = RandomStringUtils.random(10, true, true);
            String value = RandomStringUtils.random(10, true, true);

            keys.add(key);
            values.add(value);
            map.put(key, value);
        }

        KEYS = Collections.unmodifiableList(keys);
        VALUES = Collections.unmodifiableList(values);
        MAP = Collections.unmodifiableMap(map);
    }

}

@@ -864,25 +864,24 @@
 ap%3C%3E();%0A
-%0A
         
 for (int
@@ -876,33 +876,84 @@
     
-for (int i = 0; i
+Set%3CString%3E uniqueKeys = new HashSet%3C%3E();%0A%0A        while (map.size()
  %3C COUNT
 ; i+
@@ -952,13 +952,8 @@
 OUNT
-; i++
 ) %7B%0A
@@ -1086,24 +1086,68 @@
 ue, true);%0A%0A
+            if (uniqueKeys.add(key)) %7B%0A%0A    
             
@@ -1161,16 +1161,20 @@
 d(key);%0A
+    
         
@@ -1208,16 +1208,20 @@
         
+  
+  
 map.put(
@@ -1225,32 +1225,46 @@
 ut(key, value);%0A
+            %7D%0A
         %7D%0A%0A     

Fix RandomKeys generation