Added ability to create mocks for methods that use the constructor pattern.