public void moveCartItem(int fromIndex,int toIndex){
  if (toIndex < fromIndex) {
    cartLines.add(toIndex,cartLines.remove(fromIndex));
  }
 else   if (toIndex > fromIndex) {
    cartLines.add(toIndex - 1,cartLines.remove(fromIndex));
  }
}

public void moveCartItem ( int fromIndex , int toIndex ) { if ( toIndex < fromIndex ) { cartLines . add ( toIndex , cartLines . remove ( fromIndex ) ) ; } else if ( toIndex > fromIndex ) { cartLines . add ( toIndex - 1 , cartLines . remove ( fromIndex ) ) ; } }
moves a line item to a different index .
