private List < ? > getNewOptions ( final String [ ] paramValues ) { // Take a copy of the old options List < ? > copyOldOptions = new ArrayList ( getOptions ( ) ) ; // Create a new list to hold the shuffled options List < Object > newOptions = new ArrayList <> ( paramValues . length ) ; // Process the option parameters for ( String param : paramValues ) { for ( Object oldOption : copyOldOptions ) { // Match the string value of the option String stringOldOption = String . valueOf ( oldOption ) ; if ( Util . equals ( stringOldOption , param ) ) { newOptions . add ( oldOption ) ; copyOldOptions . remove ( oldOption ) ; break ; } } } return newOptions ; }
Shuffle the options .