Switch test / example code to use a hashMap