class OptionsAndArgs {

    public Pattern getProcessPattern() {
        String arg = extraArgs.size() > 0 ? extraArgs.get(0) : null;
        try {
            return arg != null && getPid() == null ?
                    Pattern.compile(arg, Pattern.CASE_INSENSITIVE)
                    : null;
        } catch (PatternSyntaxException exp) {
            throw new IllegalArgumentException("Invalid pattern '" + arg + "' for matching process names", exp);
        }

    }

    public  OptionsAndArgs(Set<String> pCommands, String ... pArgs);

}