improved test function to exercise set() and get() methods