question: public static Object convertToParameterValues ( Object object ) { Collection < Object > collection ; if ( object instanceof Object [ ] ) { collection = Arrays . asList ( ( Object [ ] ) object ) ; } else if ( object instanceof Collection ) { collection = ( Collection < Object > ) object ; } else { LOGGER . warn ( "Unable to convert value, ignoring" ) ; return new Object [ ] { } ; } List < Object > s = new LinkedList < Object > ( ) ; for ( Object o : collection ) { Object converted = convertToParameterValue ( o ) ; if ( converted instanceof Object [ ] ) { s . addAll ( Arrays . asList ( ( Object [ ] ) converted ) ) ; } else { s . add ( converted ) ; } } return s . toArray ( new Object [ s . size ( ) ] ) ; }
target:  Converts an array/collection of values (the object) to a parameter values array. Resources should not be converted. Use via convertToParameterValue (to deal with non-lists)