class Utils {

    public static Object getMethodArg(final int index, final Object[] args, final String methodDesc) {
        if (index < 0) {
            throw new InvalidParameterException(String.format("An index of %s is invalid", index));
        }
        if (args.length <= index) {
            throw new InvalidParameterException(String.format("An index of %s is too big for the number of arguments in [%s]", index,
                    methodDesc));
        }
        final Object indexObject = args[index];
        if (indexObject == null) {
            throw new InvalidParameterException(String.format("The argument passed into [%s] at index %s is null.", methodDesc, index));
        }
        return indexObject;
    }

    private  Utils();

}