def set_and_get(self, new_value):
return self._encode_invoke(atomic_reference_set_and_get_codec,<EOL>new_value=self._to_data(new_value))<EOL>
Sets and gets the value.

:param new_value: (object), the new value.
:return: (object), the new value.