### Question:
InMemoryStore implements ToDoStore { @Override public ToDo update(String id, ToDo td) { synchronized(store) { ToDo old = store.get(id); if(old == null) { return null; } else { old.setCompleted(td.isCompleted()); old.setTitle(td.getTitle()); } store.put(id, old); return old; } } InMemoryStore(); @Override Collection<ToDo> getAll(); @Override ToDo get(String id); @Override ToDo persist(ToDo td); @Override ToDo update(String id, ToDo td); @Override void delete(String id); @Override int count();  }### Answer:
@Test public void testUpdate() throws Exception { ToDo td = new ToDo(); td.setCompleted(true); assertNull(emptyStore.update("123", td)); populatedStore.update(td1.getId(), td); td = populatedStore.get(td1.getId()); assertEquals("", td.getTitle()); assertTrue(td.isCompleted()); }