added singleton template

This template is made for aiming at complete singleton and the test case.