Add applyJoinTemplateList, and a test for it