improve test for testCreateInstance and testCreateSubclass