Finished helper procedures for tests and added first test for locks.