added tests for #apply method