/**
 * 
 */
package com.github.ansell.jdefaultdict;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentMap;

import org.junit.Test;

/**
 * Tests for {@link JDefaultDict}
 * 
 * @author Peter Ansell p_ansell@yahoo.com
 */
public class JDefaultDictTest {

	@Test
	public final void testGetExists() {
		ConcurrentMap<String, List<String>> test = new JDefaultDict<>(
				k -> new ArrayList<>());
		assertFalse(test.containsKey("test"));
		test.put("test", new ArrayList<>());
		assertTrue(test.containsKey("test"));
		List<String> testList = test.get("test");
		assertNotNull(testList);
		assertTrue(testList.isEmpty());
	}

	@Test
	public final void testGetNotExists() {
		ConcurrentMap<String, List<String>> test = new JDefaultDict<>(
				k -> new ArrayList<>());
		assertFalse(test.containsKey("test"));
		List<String> testList = test.get("test");
		assertNotNull(testList);
		assertTrue(testList.isEmpty());
	}

}

@@ -980,10 +980,360 @@
 ));%0A%09%7D%0A%0A
+%09@Test%0A%09public final void testGetChained() %7B%0A%09%09ConcurrentMap%3CString, ConcurrentMap%3CString, List%3CString%3E%3E%3E test = new JDefaultDict%3C%3E(%0A%09%09%09%09k1 -%3E new JDefaultDict%3C%3E(k2 -%3E new ArrayList%3C%3E()));%0A%09%09assertFalse(test.containsKey(%22test%22));%0A%09%09List%3CString%3E testList = test.get(%22test%22).get(%22test%22);%0A%09%09assertNotNull(testList);%0A%09%09assertTrue(testList.isEmpty());%0A%09%7D%0A
 %7D%0A

Add chaining test