public void swap(int positionOne,int positionTwo){
synchronized (lock) {
    if (items == null || positionOne == positionTwo || positionOne < 0 || positionOne >= getItemCount() || positionTwo < 0 || positionTwo >= getItemCount()) {
      return;
    }
    T temp=items.get(positionOne);
    items.set(positionOne,items.get(positionTwo));
    items.set(positionTwo,temp);
  }
  if (notifyOnChange) {
    notifyItemsSwapped(positionOne,positionTwo);
  }
}

public void swap ( int positionOne , int positionTwo ) { synchronized ( lock ) { if ( items == null || positionOne == positionTwo || positionOne < 0 || positionOne >= getItemCount ( ) || positionTwo < 0 || positionTwo >= getItemCount ( ) ) { return ; } T temp = items . get ( positionOne ) ; items . set ( positionOne , items . get ( positionTwo ) ) ; items . set ( positionTwo , temp ) ; } if ( notifyOnChange ) { notifyItemsSwapped ( positionOne , positionTwo ) ; } }
swaps the items with the specified positions in the list . if either position is out of bounds then no action will be performed .
