Removed unneccesary iteration of object and instead directly cast to
Collection<Task>