Also refactor the apply tests to use a common type now that there are three variants that do almost the same thing for each test.