public boolean moveItem(String uid,int position){
  if (items == null || position < 0 || position > items.size()) {
    return false;
  }
  int index=items.indexOf(new DashboardItem(uid));
  if (index == -1 || index == position || (index + 1) == position) {
    return false;
  }
  DashboardItem item=items.get(index);
  index=position < index ? (index + 1) : index;
  items.add(position,item);
  items.remove(index);
  return true;
}

public boolean moveItem ( String uid , int position ) { if ( items == null || position < 0 || position > items . size ( ) ) { return false ; } int index = items . indexOf ( new DashboardItem ( uid ) ) ; if ( index == - 1 || index == position || ( index + 1 ) == position ) { return false ; } DashboardItem item = items . get ( index ) ; index = position < index ? ( index + 1 ) : index ; items . add ( position , item ) ; items . remove ( index ) ; return true ; }
moves an item in the list . returns true if the operation lead to a modification of the list order . returns false if there are no items , the given position is out of bounds , the item is not present , if position is equal to current item index or if attempting to move an item one position to the right ( pointless operation ) .
