package com.github.kratorius.cuckoohash;

import junit.framework.TestCase;
import org.junit.Before;

import java.util.Map;

public class CuckooHashMapTest extends TestCase {
  private CuckooHashMap<Character, Boolean> mCB;

  @Before
  public void setUp() {
    mCB = new CuckooHashMap<>();
  }

  public void testContainsKey() {
    try {
      mCB.containsKey(null);
      fail("accepted null key");
    } catch (NullPointerException e) {
      // Expected.
    }

    mCB.put('A', true);
    mCB.put('B', true);
    mCB.put('C', true);

    assertTrue(mCB.containsKey('A'));
    assertTrue(mCB.containsKey('B'));
    assertTrue(mCB.containsKey('C'));
    assertFalse(mCB.containsKey('D'));
  }
}

@@ -98,31 +98,8 @@
 e;%0A%0A
-import java.util.Map;%0A%0A
 publ
@@ -224,24 +224,24 @@
 d setUp() %7B%0A
-
     mCB = ne
@@ -266,16 +266,1013 @@
 );%0A  %7D%0A%0A
+  public void testPut() %7B%0A    assertTrue(mCB.isEmpty());%0A    mCB.put('A', true);%0A    mCB.put('B', false);%0A    assertFalse(mCB.isEmpty());%0A%0A    assertEquals(true, (boolean) mCB.get('A'));%0A    assertEquals(false, (boolean) mCB.get('B'));%0A    assertNull(mCB.get('C'));%0A  %7D%0A%0A  public void testGet() %7B%0A    assertTrue(mCB.isEmpty());%0A    assertNull(mCB.get('A'));%0A%0A    mCB.put('A', true);%0A    assertEquals(true, (boolean) mCB.get('A'));%0A    assertFalse(mCB.isEmpty());%0A  %7D%0A%0A  public void testRemove() %7B%0A    assertTrue(mCB.isEmpty());%0A%0A    // Should never fail if the key didn't exist.%0A    assertNull(mCB.remove('A'));%0A    assertNull(mCB.remove('B'));%0A    assertNull(mCB.remove('C'));%0A%0A    mCB.put('A', true);%0A    mCB.put('B', false);%0A    assertEquals(2, mCB.size());%0A%0A    assertEquals(false, (boolean) mCB.remove('B'));%0A    assertEquals(1, mCB.size());%0A    assertNull(mCB.get('B'));%0A%0A    assertEquals(true, (boolean) mCB.remove('A'));%0A    assertEquals(0, mCB.size());%0A    assertNull(mCB.get('A'));%0A  %7D%0A%0A
   public

Add tests for put, get and remove