### Question:
WrappedCache implements Cache<K, V> { @Override public <T> T invoke( K key, EntryProcessor<K, V, T> entryProcessor, Object... arguments ) throws EntryProcessorException { assertNotClosed(); return invokeAll( ImmutableSet.of( key ), entryProcessor, arguments ).get( key ).get(); } WrappedCache( com.google.common.cache.Cache<K, V> guavaCache ); @Override V get( K key ); @Override Map<K, V> getAll( Set<? extends K> keys ); @Override boolean containsKey( K key ); @Override void loadAll( Set<? extends K> keys, boolean replaceExistingValues, CompletionListener completionListener ); @Override void put( K key, V value ); @Override V getAndPut( K key, V value ); @Override void putAll( Map<? extends K, ? extends V> map ); @Override boolean putIfAbsent( K key, V value ); @Override boolean remove( K key ); @Override boolean remove( K key, V oldValue ); @Override V getAndRemove( K key ); @Override boolean replace( K key, V oldValue, V newValue ); @Override boolean replace( K key, V value ); @Override V getAndReplace( K key, V value ); @Override void removeAll( Set<? extends K> keys ); @Override void removeAll(); @Override void clear(); @Override T invoke( K key, EntryProcessor<K, V, T> entryProcessor, Object... arguments ); @Override Map<K, EntryProcessorResult<T>> invokeAll( final Set<? extends K> keys,
                                                        final EntryProcessor<K, V, T> entryProcessor,
                                                        final Object... arguments ); @Override Iterator<Entry<K, V>> iterator(); @Override void registerCacheEntryListener( CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration ); @Override void deregisterCacheEntryListener( CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration ); @Override void close(); @Override boolean isClosed(); @Override T unwrap( Class<T> clazz );  }### Answer:
@Test public void testInvoke() throws Exception { Map<Object, Object> values = ImmutableMap.<Object, Object>of( "key1", "value1", "key2", "value2" ); cache.putAll( values ); Map<Object, EntryProcessorResult<Object>> resultMap = cache.invokeAll( values.keySet(), new EntryProcessor<Object, Object, Object>() { @Override public Object process( MutableEntry<Object, Object> entry, Object... arguments ) throws EntryProcessorException { if ( entry.getKey().equals( "key1" ) && entry.getValue().equals( "value1" ) ) { entry.setValue( "other value" ); return "result1"; } else if ( entry.getKey().equals( "key2" ) && entry.getValue().equals( "value2" ) ) { entry.remove(); return "result2"; } throw new AssertionError( "Unexptected entry: " + entry ); } } ); assertThat( resultMap.get( "key1" ).get(), equalTo( (Object) "result1" ) ); assertThat( resultMap.get( "key2" ).get(), equalTo( (Object) "result2" ) ); Cache.Entry<Object, Object> onlyElement = Iterables.getOnlyElement( cache ); assertThat( onlyElement.getKey(), is( (Object) "key1" ) ); assertThat( onlyElement.getValue(), is( (Object) "other value" ) ); }