private static HashMap <String, Object> getParameters(String[] args) throws InvalidParameterException {
        HashMap <String, Object> arguments = new HashMap <String, Object>();
        if ((args.length < 3) || (args.length > 5)) {
            throw new InvalidParameterException("Invalid number of parameters!");
        }
        
        arguments.put("initDate", args[0]);
        arguments.put("endDate", args[1]);
        arguments.put("users", Arrays.asList(args[2].split(",")));
        arguments.put("keys", null);
        boolean testMode = false;
        
        if (args.length == 4) {
            if ((args[3].equals("--test-mode"))) {
                testMode = true;
            } else {
                arguments.put("keys", Arrays.asList(args[3].split(",")));
            }
        } else if (args.length == 5) {
            if ((args[3].equals("--test-mode"))) {
                testMode = true;
                arguments.put("keys", Arrays.asList(args[4].split(",")));
            } else if ((args[4].equals("--test-mode"))) {
                testMode = true;
                arguments.put("keys", Arrays.asList(args[3].split(",")));
            } else {
                throw new InvalidParameterException("Invalid parameters!");
            }
        }

        arguments.put("testMode", testMode);

        
        SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");
        format.setLenient(false);
        try { 
            format.parse((String) arguments.get("initDate"));
            format.parse((String) arguments.get("endDate"));
        } catch (ParseException ex) {
            throw new InvalidParameterException("Invalid date format!");
        }
        
        return arguments;
    }