Returns a new argument array.
@param args input arguments, any argument being null will be ignored
@return argument array, null if none provided
431508
public static SkbShellArgument[] newArgumentArray(SkbShellArgument ... args){
		if(args==null){
			return null;
		}
		Set<SkbShellArgument> ret = new HashSet<>();
		for(SkbShellArgument arg : args){
			if(arg!=null){
				ret.add(arg);
			}
		}
		return ret.toArray(new SkbShellArgument[args.length]);
	}
145726
public static String[] removeFirst(String[] args) {
		String[] args2 = new String[args.length - 1];
		System.arraycopy(args, 1, args2, 0, args2.length);
		return args2;
	}
493528
public static JUnitCommandLineParseResult parse(String[] args) {
        JUnitCommandLineParseResult result = new JUnitCommandLineParseResult();

        result.parseArgs(args);

        return result;
    }
192408
public static <T> List<T> createList(T... args) {
        ArrayList<T> newList = new ArrayList<T>();
        Collections.addAll(newList, args);
        return newList;
    }
977644
protected String getArguments(Object[] args) {

        if (args == null || args.length == 0) {
            return "";
        }

        StringBuilder sb = new StringBuilder();

        if (args.length == 1) {
            Object arg = args[0];
            String param = getSingleArgParameterAsString(arg);
            String displayParam = getSingleArgDisplayParameter(param);
            if (arg instanceof String) {
                sb.append("\"");
                sb.append(displayParam);
                sb.append("\"");
            } else {
                sb.append(displayParam);
            }
        } else {
            for (int i = 0; i < args.length; i++) {
                Object arg = args[i];
                boolean lastArg = i == args.length - 1;
                String param = getParameterAsString(arg);
                String displayParam = getDisplayParameter(param);
                if (arg instanceof String) {
                    sb.append("\"");
                    sb.append(displayParam);
                    sb.append("\"");
                } else {
                    sb.append(displayParam);
                }

                if (!lastArg) {
                    sb.append(",");
                }
            }
        }

        return sb.toString();
    }
565743
function copyArgumentsArray(args) {
	var copy = [];
	var index = 0;
	for (var i in args) {
		copy[index] = args[i];
		index++;
	}
	return copy;
}
1084193
@SafeVarargs
	public static <T> T firstNotNull(T... args) {
		for (T arg : args) {
			if (arg != null)
				return arg;
		}
		return null;
	}
479990
public final void setArgs(String... args) throws CmdArgsException
    {
        try
        {
            options = new HashMap<>();
            Option opt = null;
            int index = 0;
            for (String arg : args)
            {
                if (opt != null)
                {
                    options.put(opt.name, ConvertUtility.convert(opt.cls, arg));
                    opt = null;
                }
                else
                {
                    if (map.containsKey(arg))
                    {
                        opt = map.get(arg);
                        if (opt.exclusiveGroup != null)
                        {
                            if (effectiveGroup != null && !effectiveGroup.equals(opt.exclusiveGroup))
                            {
                                throw new CmdArgsException(opt.exclusiveGroup+" mix with "+effectiveGroup, this);
                            }
                            effectiveGroup = opt.exclusiveGroup;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                index++;
            }
            // defaults
            for (Option o : map.values())
            {
                if (!o.mandatory && !options.containsKey(o.name))
                {
                    options.put(o.name, o.defValue);
                }
            }
            int len = args.length-index;
            if (hasArrayArgument)
            {
                if (len < types.size())
                {
                    throw new CmdArgsException("too few arguments", this);
                }
            }
            else
            {
                if (len != types.size())
                {
                    throw new CmdArgsException("wrong number of arguments", this);
                }
            }
            arguments = new HashMap<>();
            int arraySize = len - types.size() + 1;
            int arrayIndex = Integer.MAX_VALUE;
            Object array = null;
            Class<?> componenType = null;
            if (hasArrayArgument)
            {
                arrayIndex = types.size()-1;
                Class<?> arrayType = types.get(arrayIndex);
                componenType = arrayType.getComponentType();
                array = Array.newInstance(componenType, arraySize);
                arguments.put(names.get(arrayIndex), array);
            }
            for (int ii=0;ii<len;ii++)
            {
                if (ii < arrayIndex)
                {
                    Object value = ConvertUtility.convert(types.get(ii), args[ii+index]);
                    arguments.put(names.get(ii), value);
                }
                else
                {
                    Object value = ConvertUtility.convert(componenType, args[ii+index]);
                    Array.set(array, ii - arrayIndex, value);
                }
            }
            for (Option o : map.values())
            {
                if (o.mandatory && !options.containsKey(o.name))
                {
                    throw new CmdArgsException("mandatory option "+o.name+": "+o.description+" missing", this);
                }
            }
            if (effectiveGroup != null)
            {
                for (Option o : groups.get(effectiveGroup))
                {
                    if (o.mandatory && !options.containsKey(o.name))
                    {
                        throw new CmdArgsException(effectiveGroup+" option "+o.name+": "+o.description+" missing", this);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw new CmdArgsException(ex, this);
        }
    }
852728
function varargs(args) {

  var argl = args.length;
  var arga;

  if (!Array.isArray(args)) {
    arga = new Array(argl);
    for (var i = 0; i < argl; i++) {
      arga[i] = args[i];
    }
  }

  return arga;
}
230285
@SuppressWarnings("nullness")
  private static <T> T castNonNull(@javax.annotation.Nullable T arg) {
    return arg;
  }
478616
public static <K, V> Map<K, V> newHashMap(Object... args) {
        Map<K, V> m = new HashMap<K, V>();
        for (int i = 0; i < args.length; i += 2) {
            m.put((K) args[i], i + 1 >= args.length ? null : (V) args[i + 1]);
        }
        return m;
    }
1254153
public void addArgument(AstNode arg) {
        assertNotNull(arg);
        if (arguments == null) {
            arguments = new ArrayList<AstNode>();
        }
        arguments.add(arg);
        arg.setParent(this);
    }
285568
public java.util.List<String> getArgs() {
        if (args == null) {
            args = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return args;
    }
643740
public TBase<?, ?> newArgs(List<Object> args) {
        requireNonNull(args, "args");
        final TBase<?, ?> newArgs = newArgs();
        final int size = args.size();
        for (int i = 0; i < size; i++) {
            ThriftFieldAccess.set(newArgs, argFields[i], args.get(i));
        }
        return newArgs;
    }
54326
private static Object generateKey(final Object[] args) {
        if (args == null) return Collections.emptyList();
        Object[] copyOfArgs = copyOf(args, args.length);
        return asList(copyOfArgs);
    }
1083088
private V8Array convertArguments(Object[] args, Set<V8Value> newValues) {
		//create the array
		V8Array result = new V8Array(runtime);
		newValues.add(result);
		
		//convert the values
		for (int i = 0; i < args.length; ++i) {
			Object o = args[i];
			if (o == null) {
				result.push(V8Value.NULL);
			} else if (o instanceof JsonObject || o instanceof Collection ||
					o.getClass().isArray() || o instanceof Map) {
				V8Object v = runtime.executeObjectScript("(" +
						createJsonBuilder().toJson(o).toString() + ")");
				newValues.add(v);
				result.push(v);
			} else if (o instanceof String) {
				result.push((String)o);
			} else if (o instanceof Integer) {
				result.push((Integer)o);
			} else if (o instanceof Boolean) {
				result.push((Boolean)o);
			} else if (o instanceof Double) {
				result.push((Double)o);
			} else if (o instanceof ItemDataProvider) {
				o = new ItemDataProviderWrapper((ItemDataProvider)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof AbbreviationProvider) {
				o = new AbbreviationProviderWrapper((AbbreviationProvider)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof VariableWrapper) {
				o = new VariableWrapperWrapper((VariableWrapper)o);
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof V8ScriptRunner || o instanceof LocaleProvider) {
				V8Object v8o = convertJavaObject(o);
				newValues.add(v8o);
				result.push(v8o);
			} else if (o instanceof V8Value) {
				//already converted
				V8Value v = (V8Value)o;
				result.push(v);
			} else {
				throw new IllegalArgumentException("Unsupported argument: " +
						o.getClass());
			}
		}
		return result;
	}
1320358
public static Object [] unwrap( Object[] args )
    {
        if ( args == null )
            return null;
        Object [] oa = new Object[ args.length ];
        for(int i=0; i<args.length; i++)
            oa[i] = unwrap( args[i] );
        return oa;
    }