code: public Observable<Boolean> updateConversations(List<ChatConversation> conversationsToUpdate) {
  
          return asObservable(new Executor<Boolean>() {
              @Override
              void execute(ChatStore store, Emitter<Boolean> emitter) {
  
                  store.beginTransaction();
  
                  boolean isSuccess = true;
  
                  for (ChatConversationBase conversation : conversationsToUpdate) {
                      ChatConversationBase.Builder toSave = ChatConversationBase.baseBuilder();
  
                      ChatConversationBase saved = store.getConversation(conversation.getConversationId());
                      if (saved != null) {
                          toSave.setConversationId(saved.getConversationId());
                          toSave.setFirstLocalEventId(saved.getFirstLocalEventId());
                          toSave.setLastLocalEventId(saved.getLastLocalEventId());
                          if (conversation.getLastRemoteEventId() == null) {
                              toSave.setLastRemoteEventId(saved.getLastRemoteEventId());
                          } else {
                              toSave.setLastRemoteEventId(Math.max(saved.getLastRemoteEventId(), conversation.getLastRemoteEventId()));
                          }
                          if (conversation.getUpdatedOn() == null) {
                              toSave.setUpdatedOn(System.currentTimeMillis());
                          } else {
                              toSave.setUpdatedOn(conversation.getUpdatedOn());
                          }
                          toSave.setETag(conversation.getETag());
                      }
                      isSuccess = isSuccess && store.update(toSave.build());
                  }
  
                  store.endTransaction();
  
                  emitter.onNext(isSuccess);
                  emitter.onCompleted();
              }
          });
  
      }
docs: Update conversations.
  
  @param conversationsToUpdate List of conversations to apply an update.
  @return Observable emitting result.