public static synchronized <T> T createStrictMockAndExpectNew(Class<T> type, Object... arguments) throws Exception {
        T mock = createStrictMock(type);
        expectStrictNew(type, arguments).andReturn(mock);
        return mock;
    }
public static synchronized < T > T createStrictMockAndExpectNew ( Class < T > type , Object ... arguments ) throws Exception { T mock = createStrictMock ( type ) ; expectStrictNew ( type , arguments ) . andReturn ( mock ) ; return mock ; }
Convenience method for createStrictMock followed by expectNew.

@param type      The class that should be mocked.
@param arguments The constructor arguments.
@return A mock object of the same type as the mock.
@throws Exception