code: public Observable<Integer> deleteOrphanedEvents(String[] ids) {
  
          return Observable.fromCallable(() -> {
              SQLiteDatabase writable = dbHelper.getWritableDatabase();
              if (ids.length > 0) {
                  int numberOfRows = writable.delete(DbOrphanedEvent.TABLE_NAME, DbOrphanedEvent.EVENT_ID + " IN " + queryPlaceholder(ids.length), ids);
                  log.d("Deleted " + numberOfRows + " orphaned events with ids " + Arrays.toString(ids));
                  return numberOfRows;
              } else {
                  return 0;
              }
          });
      }
docs: Delete orphaned events (events returned in message query related to some message that was send later then messages obtained from the query. Should be used to update messages in previous message pages.)
  
  @param ids Events unique identifiers for orophaned events that should be deleted from database.
  @return Observable returning number of deleted rows in database.