@Override
  public boolean addAll(final Collection<? extends String> collection) {
    final int initialSize = domains.size();
    for (final String string : collection) {
      if (Strings.isNullOrEmpty(string)) {
        throw new IllegalArgumentException("Domain cannot be empty string or null string.");
      }
      for (final String s : Splitter.onPattern("\\s*,+\\s*").split(string)) {
        if ("all".equals(s)) {
          domains.add("*");
        } else {
          domains.add(s);
        }
      }
    }

    if (domains.contains("none")) {
      if (domains.size() > 1) {
        throw new IllegalArgumentException("Value 'none' can't be used with other domains");
      }
    } else if (domains.contains("*")) {
      if (domains.size() > 1) {
        throw new IllegalArgumentException("Values '*' or 'all' can't be used with other domains");
      }
    } else {
      try {
        final StringJoiner stringJoiner = new StringJoiner("|");
        domains.forEach(stringJoiner::add);
        Pattern.compile(stringJoiner.toString());
      } catch (final PatternSyntaxException e) {
        throw new IllegalArgumentException("Domain values result in invalid regex pattern", e);
      }
    }

    return domains.size() != initialSize;
  }
Instantiates a new Cors allowed origins property.
app/src/main/java/org/hyperledger/besu/cli/custom/CorsAllowedOriginsProperty.java