question: public static < T > List < T > shiftElementsToEnd ( final List < T > source , final int count ) { final ArrayList < T > rVal = new ArrayList < > ( source . size ( ) ) ; for ( int i = count ; i < source . size ( ) ; i ++ ) { rVal . add ( source . get ( i ) ) ; } for ( int i = 0 ; i < count ; i ++ ) { rVal . add ( source . get ( i ) ) ; } if ( source . size ( ) != rVal . size ( ) ) { throw new IllegalStateException ( "Didnt work for: " + count + " " + source + " : " + rVal ) ; } return rVal ; }
target:  returns a list of everything in source, with the first count units moved to the end