GenericDAO { public void delete(PK id) { try (Connection connection = connectionProvider.get()) { R.table(tableName).get(id).delete().run(connection); } } GenericDAO(Provider<Connection> connection, Class<T> clazz, String tableName, String primaryKey); void initTable(); void create(T model); Optional<T> read(PK id); DAOIterator<T> read(); DAOIterator<T> read(Function<Table, ReqlExpr> filter); void update(PK id, T model); void updateNonAtomic(PK id, T model); void delete(PK id); Observable<ChangeFeedElement<T>> changes(); @SuppressWarnings("unchecked") Observable<ChangeFeedElement<T>> changes(Function<Table, ReqlExpr> filter);  }
@Test public void delete() { TestModel model = new TestModel("1"); dao.create(model); dao.delete("1"); assertThat(dao.read("1")).isNotPresent(); }