IdGenerator - tests and implementation