Applies a function on the value, the actual stored value will not change.

        :param function: (Function), A stateful serializable object which represents the Function defined on
            server side.
            This object must have a serializable Function counter part registered on server side with the actual
            ``org.hazelcast.core.IFunction`` implementation.
        :return: (object), the result of the function application.

def apply(self, function):
        """
        Applies a function on the value, the actual stored value will not change.

        :param function: (Function), A stateful serializable object which represents the Function defined on
            server side.
            This object must have a serializable Function counter part registered on server side with the actual
            ``org.hazelcast.core.IFunction`` implementation.
        :return: (object), the result of the function application.
        """
        check_not_none(function, "function can't be None")
        return self._encode_invoke(atomic_reference_apply_codec, function=self._to_data(function))