### Question:
CrudDAO { public int add(T entity) { return this.wrapper.wrapAndExecute(session -> { session.save(entity); return entity.getId(); }); } 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 add() { int entityId = this.getTestDao().add(this.getTestEntity()); T resultEntity = this.getTestDao().findById(entityId); resultEntity.setId(0); assertThat(resultEntity, is(this.getTestEntity())); }