public static Class<?>[] buildArgumentClasses( Object... arguments ) {
        if (arguments == null || arguments.length == 0) return EMPTY_CLASS_ARRAY;
        Class<?>[] result = new Class<?>[arguments.length];
        int i = 0;
        for (Object argument : arguments) {
            if (argument != null) {
                result[i] = argument.getClass();
            } else {
                result[i] = null;
            }
        }
        return result;
    }
public static Class < ? > [ ] buildArgumentClasses ( Object ... arguments ) { if ( arguments == null || arguments . length == 0 ) return EMPTY_CLASS_ARRAY ; Class < ? > [ ] result = new Class < ? > [ arguments . length ] ; int i = 0 ; for ( Object argument : arguments ) { if ( argument != null ) { result [ i ] = argument . getClass ( ) ; } else { result [ i ] = null ; } } return result ; }
Build the list of classes that correspond to the list of argument objects.

@param arguments the list of argument objects.
@return the list of Class instances that correspond to the list of argument objects; the resulting list will contain a null
element for each null argument.