Implement deleteBy and deleteById with tests