### Question:
SimpleCachedDaoImpl implements SimpleCachedDao<K, V> { @Override public V update(@Nonnull final K key, @Nullable final V value) { final V previousValue; if (value != null) { previousValue = cache.put(key, value); } else { previousValue = cache.remove(key); } return previousValue; } SimpleCachedDaoImpl(); @Override V update(@Nonnull final K key, @Nullable final V value); @Override Optional<V> find(@Nonnull final K key); @Override void invalidateCache(); @Override boolean isEmpty(); @Override Iterable<V> values(); @Override Iterable<K> keySet();  }### Answer:
@Test public void testUpdate() throws Exception { dao.update(KEY_1, DUMMY_DATA_1); final Optional<DummyDataObject> dataOpt = dao.find(KEY_1); Assert.assertTrue(dataOpt.isPresent()); Assert.assertEquals(DUMMY_DATA_1.getDummyData(), dataOpt.get().getDummyData()); }