private static Object[] unwrapArgs(Object arguments) {
if (arguments == null) {
return MetaClassHelper.EMPTY_ARRAY;
} else if (arguments instanceof Tuple) {
Tuple tuple = (Tuple) arguments;
return tuple.toArray();
} else if (arguments instanceof Object[]) {
return (Object[])arguments;
} else {
return new Object[]{arguments};
}