code: def replace_if_same(self, key, old_value, new_value):
          
          check_not_none(key, "key can't be none")
          check_not_none(old_value, "old_value can't be none")
          check_not_none(new_value, "new_value can't be none")
          return self._encode_invoke(transactional_map_replace_if_same_codec, key=self._to_data(key),
                                     old_value=self._to_data(old_value), new_value=self._to_data(new_value))
docs: Transactional implementation of :func:`Map.replace_if_same(key, old_value, new_value)
          <hazelcast.proxy.map.Map.replace_if_same>`
  
          The object to be replaced will be accessible only in the current transaction context till the transaction is
          committed.
  
          :param key: (object), the specified key.
          :param old_value: (object), replace the key value if it is the old value.
          :param new_value: (object), the new value to replace the old value.
          :return: (bool), ``true`` if the value was replaced, ``false`` otherwise.