fix(lib): add lifetime bound
fix(test): `TreeSet` is dead, use `HashSet` instead