LazyBindingMap extends AbstractMap<K, V> implements Immutable { @Override public boolean containsValue(final Object value) { final V cast = codec.getBindingClass().cast(requireNonNull(value)); final V found = get(cast.key()); return found != null && cast.equals(found); } private  LazyBindingMap(final Unordered<K, V> codec, final MapNode mapNode); @Override int size(); @Override V remove(final Object key); @Override @SuppressWarnings("checkstyle:parameterName") void putAll(final Map<? extends K, ? extends V> m); @Override void clear(); @Override boolean containsKey(final Object key); @Override boolean containsValue(final Object value); @Override V get(final Object key); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Entry<K, V>> entrySet();  }
@Test public void testLookupContainsValueThrows() { final Map<TopLevelListKey, TopLevelList> list = prepareData().getTopLevelList(); assertThrows(NullPointerException.class, () -> list.containsValue(null)); assertThrows(ClassCastException.class, () -> list.containsValue(mock(DataObject.class))); }