import from http://google-singleton-detector.googlecode.com/svn/trunk/@107