### Question:
ObjectsChangedMapUpdater implements ThreadSafeMultimap.MapUpdater<K, V> { @Nullable @Override public Map<K, List<V>> update(@Nonnull Map<K, List<V>> map) { if (containsChangedObjects(map)) { Map<K, List<V>> result = ThreadSafeMultimap.copy(map); for (List<V> objects : result.values()) { for (int i = 0; i < objects.size(); i++) { final V object = objects.get(i); for (V changedObject : changedObjects) { if (object.equals(changedObject)) { objects.set(i, changedObject); } } } } return result; } else { return null; } } ObjectsChangedMapUpdater(@Nonnull V changedObject);  ObjectsChangedMapUpdater(@Nonnull Collection<V> changedObjects); @Nullable @Override Map<K, List<V>> update(@Nonnull Map<K, List<V>> map);  }### Answer:
@Test public void testShouldUpdateObject() throws Exception { final TestObject oldObject = map.get(5).get(5); final TestObject expected = new TestObject(oldObject.index); multimap.update(new ObjectsChangedMapUpdater<Integer, TestObject>(expected)); assertNotSame(oldObject, multimap.get(5).get(5)); assertSame(expected, multimap.get(5).get(5)); }
@Test public void testShouldNotCopyAllListsIfObjectDoesntExist() throws Exception { final TestObject oldObject = new TestObject(10000); final List<TestObject> expected = multimap.asMap().get(5); multimap.update(new ObjectsChangedMapUpdater<Integer, TestObject>(oldObject)); final List<TestObject> actual = multimap.asMap().get(5); assertSame(expected, actual); }