Added a method taskIsEmpty to Job.