added test code for singleton classes