Modify test cursor to be able to test toMap method
Extract constant
Use library function where possible
Add tests for toMap method