@@ -0,0 +1,1423 @@
+package com.github.kratorius.cuckoohash;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Random;%0A%0A/**%0A * Tests for the put() method of the Cuckoo hash map.%0A */%0Apublic class PutTest extends TestCase %7B%0A  @SuppressWarnings(%22MismatchedQueryAndUpdateOfCollection%22)%0A  public void testNullKey() %7B%0A    CuckooHashMap%3CCharacter, Boolean%3E m = new CuckooHashMap%3C%3E();%0A%0A    try %7B%0A      m.put(null, true);%0A      fail(%22Accepted null key for put()%22);%0A    %7D catch (NullPointerException e) %7B%0A      // Expected.%0A    %7D%0A  %7D%0A%0A  public void testUpdate() %7B%0A    CuckooHashMap%3CCharacter, Integer%3E m = new CuckooHashMap%3C%3E();%0A%0A    m.put('A', 3);%0A    assertEquals(3, (int) m.get('A'));%0A%0A    m.put('A', 42);%0A    assertEquals(42, (int) m.get('A'));%0A  %7D%0A%0A  public void testManyKeys() %7B%0A    // Enough to generate a fair amount of rehashes but not too many so that it fits in memory%0A    // in the default heap size, and also so that it doesn't take too long to execute.%0A    final int size = 1024 * 128;%0A%0A    ArrayList%3CString%3E keys = new ArrayList%3C%3E(size);%0A    for (int i = 0; i %3C size; i++) %7B%0A      keys.add(String.valueOf(%22key-%22 + i));%0A    %7D%0A%0A    CuckooHashMap%3CString, Integer%3E m = new CuckooHashMap%3C%3E();%0A    for (int i = 0; i %3C size; i++) %7B%0A      m.put(keys.get(i), i);%0A      assertEquals(i, (int) m.get(keys.get(i)));%0A    %7D%0A%0A    for (int i = 0; i %3C size; i++) %7B%0A      assertEquals(i, (int) m.get(keys.get(i)));%0A    %7D%0A  %7D%0A%7D%0A

Add more thorough tests for put()