Only used for test.