### Question:
LruCache { public synchronized void put( K key, E element ) { if ( key == null || element == null ) { throw new IllegalArgumentException( "key=" + key + ", element=" + element ); } cache.put( key, element ); } LruCache( String name, int maxSize ); String getName(); int maxSize(); synchronized void put( K key, E element ); synchronized E remove( K key ); synchronized E get( K key ); synchronized void clear(); synchronized int size(); synchronized Set<K> keySet(); synchronized void resize( int newMaxSize ); void elementCleaned( E element );  }### Answer:
@Test void shouldThrowWhenPuttingEntryWithNullKey() { assertThrows( IllegalArgumentException.class, () -> new LruCache<>( "TestCache", 70 ).put( null, new Object() ) ); }
@Test void shouldThrowWhenPuttingEntryWithNullValue() { assertThrows( IllegalArgumentException.class, () -> new LruCache<>( "TestCache", 70 ).put( new Object(), null ) ); }