### Question:
Dictionary { public V get(Object key) { DictionaryEntry<K, V> entry = findKeyOrReturnNull(key); if (entry == null) { return null; } return entry.value; } Dictionary(); boolean isEmpty(); int size(); void clear(); void put(K key, V value); V get(Object key);  }### Answer:
@Test void testGetWithNull() { assertNull(createDictionaryWithNEntries(5).get(null)); }
@Test void testGetWithValidKey() { var dictionary = createDictionaryWithNEntries(5); for (int index = 0; index < 5; index++) { assertEquals(index, dictionary.get(index)); } }
@Test void testGetWithInvalidKeysAndEmptyCollection() { var keys = new Object[] { "štefica", 'a', 256, 3.14, new Object() }; var dictionary = createDictionaryWithNEntries(0); for (Object key : keys) { assertNull(dictionary.get(key)); } }
@Test void testGetWithInvalidKeysAndNonEmptyCollection() { var keys = new Object[] { "štefica", 'a', 256, 3.14, new Object() }; var dictionary = createDictionaryWithNEntries(10); for (Object key : keys) { assertNull(dictionary.get(key)); } }