Or it\'s better to u开发者_JAVA百科se another Design Pattern?Responded to a similar question some days ago here, mocking a Singleton. The original post is for C#.Net as regards mocking a singleton\'s