### Question:
CrudDAO { public void update(T entity) { this.wrapper.wrapAndExecute(session -> { session.update(entity); return null; }); } CrudDAO(SessionFactory sf); int add(T entity); void delete(T entity); void update(T entity); @SuppressWarnings("unchecked") T findById(int id); @SuppressWarnings("unchecked") List<T> findAll();  }### Answer:
@Test public void update() { int entityId = this.getTestDao().add(this.getTestEntity()); T upEntity = this.getSecondTestEntity(); upEntity.setId(entityId); this.getTestDao().update(upEntity); assertThat(this.getTestDao().findById(entityId), is(upEntity)); }