code: public void updateItemAt(int index, T item) {
          final T existing = get(index);
          // assume changed if the same object is given back
          boolean contentsChanged = existing == item || !mCallback.areContentsTheSame(existing, item);
          if (existing != item) {
              // different items, we can use comparison and may avoid lookup
              final int cmp = mCallback.compare(existing, item);
              if (cmp == 0) {
                  mData[index] = item;
                  if (contentsChanged) {
                      mCallback.onChanged(index, 1);
                  }
                  return;
              }
          }
          if (contentsChanged) {
              mCallback.onChanged(index, 1);
          }
          // TODO this done in 1 pass to avoid shifting twice.
          removeItemAtIndex(index, false);
          int newIndex = add(item, false);
          if (index != newIndex) {
              mCallback.onMoved(index, newIndex);
          }
      }
docs: Updates the item at the given index and calls {@link Callback#onChanged(int, int)} and/or
  {@link Callback#onMoved(int, int)} if necessary.
  <p>
  You can use this method if you need to change an existing Item such that its position in the
  list may change.
  <p>
  If the new object is a different object (<code>get(index) != item</code>) and
  {@link Callback#areContentsTheSame(Object, Object)} returns <code>true</code>, SortedList
  avoids calling {@link Callback#onChanged(int, int)} otherwise it calls
  {@link Callback#onChanged(int, int)}.
  <p>
  If the new position of the item is different than the provided <code>index</code>,
  SortedList
  calls {@link Callback#onMoved(int, int)}.
  
  @param index The index of the item to replace
  @param item  The item to replace the item at the given Index.
  @see #add(Object)