<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def collect_variables(self, variables: MultisetOfVariables) -> None: """Recursively adds all variables occuring in the expression to the given multiset. This is used internally by `variables`. Needs to be overwritten by inheriting container expression classes. This method can be used when gathering the `variables` of multiple expressions, because only one multiset needs to be created and that is more efficient. Args: variables: Multiset of variables. All variables contained in the expression are recursively added to this multiset. """

        if self.variable_name is not None:
            variables.add(self.variable_name)