@SuppressWarnings("unchecked")
    public M swapPosition(int swapPosition)
    {
        Checks.notNegative(swapPosition, "Provided swapPosition");
        Checks.check(swapPosition < orderList.size(), "Provided swapPosition is too big and is out of bounds. swapPosition: "
                + swapPosition);

        T selectedItem = orderList.get(selectedPosition);
        T swapItem = orderList.get(swapPosition);
        orderList.set(swapPosition, selectedItem);
        orderList.set(selectedPosition, swapItem);

        return (M) this;
    }
@ SuppressWarnings ( "unchecked" ) public M swapPosition ( int swapPosition ) { Checks . notNegative ( swapPosition , "Provided swapPosition" ) ; Checks . check ( swapPosition < orderList . size ( ) , "Provided swapPosition is too big and is out of bounds. swapPosition: " + swapPosition ) ; T selectedItem = orderList . get ( selectedPosition ) ; T swapItem = orderList . get ( swapPosition ) ; orderList . set ( swapPosition , selectedItem ) ; orderList . set ( selectedPosition , swapItem ) ; return ( M ) this ; }
Swaps the currently selected entity with the entity located
at the specified position. No other entities are affected by this operation.

@param  swapPosition
0 based index of target position

@throws java.lang.IllegalStateException
If no entity has been selected yet
@throws java.lang.IllegalArgumentException
If the specified position is out-of-bounds

@return The current OrderAction sub-implementation instance