This method is used for unit tests.