question: public static void randShuffleK ( ArrayList < Integer > inds , int k , Random rand ) { for ( int i = 0 ; i < k ; i ++ ) { Collections . swap ( inds , i , rand . nextInt ( inds . size ( ) ) ) ; } }
target:  Randomly shuffles k integers in a list. The first k elements are randomly swapped with other elements in the list. This method will alter the list passed to it, so situations where this would be undesirable should pass this method a copy.