code: static File resolveDirectory(String[] args) {
      return Optional.of(resolveArgument(args)).map(File::new).filter(File::isDirectory)
        .orElseThrow(() -> newIllegalArgumentException("Argument [%s] is not a valid directory", args[0]));
    }
docs: /* (non-Javadoc)