### Question:
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresent(K key); void clear(); @CheckForNull V remove(K key);  }### Answer:
@Test public void testGet_null() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); Assertions.assertThrows(NullPointerException.class, () -> { lazyInitializingMap.get(null); }); }
@Test public void testGet_initializerFunctionReturnsNull() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>( (String key) -> null); Assertions.assertThrows(NullPointerException.class, () -> { lazyInitializingMap.get("string"); }); }
@Test public void testGet() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); assertNull(lazyInitializingMap.getIfPresent("string")); lazyInitializingMap.get("string"); assertNotNull(lazyInitializingMap.getIfPresent("string")); }
@Test public void testGet2() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); Object value = lazyInitializingMap.get("string"); assertEquals("stringx", value); Object value2 = lazyInitializingMap.get("string"); assertSame(value, value2); }