This method is used by the test code.