*/
public class ArgumentsProcessor {
// expands array varArgs that are given by runtime (1, [a, b]) into true
// varArgs (1, a, b);
public static Object[] expandVarArgs(final boolean isVarArgs, final Object[] args) {
if (!isVarArgs || new ArrayUtils().isEmpty(args) || args[args.length - 1] != null && !args[args.length - 1].getClass().isArray()) {
return args == null ? new Object[0] : args;
}
final int nonVarArgsCount = args.length - 1;
Object[] varArgs;