Create a new select task with the given state supplier.
the supplier of states to check in the when() method