adds a test case for objects as custom encoder