Add mask parameter to composite and associated test