add test and method for converting grocery array to hash