Utility to cast a task into the desired task class. Useful for ignoring task nullability to cast into a new type - ensure your task exists before calling.