Implemented utilities needed for writer tests.