Extracts creation of object with mocks