[#42] Add test for new toMap() function