static CorsLogic forAllowedOrigins(Collection<String> allowedOrigins) {
        Set<String> allowedOriginsVerbatim = new HashSet<>();
        List<Pattern> allowedOriginPatterns = new ArrayList<>();
        for (String allowedOrigin : allowedOrigins) {
            if (allowedOrigin.isBlank()) continue;
            if (allowedOrigin.length() > 0) {
                if ("*".equals(allowedOrigin))
                    return new CorsLogic(true, Set.of(), List.of());
                else if (allowedOrigin.contains("*"))
                    allowedOriginPatterns.add(Pattern.compile(allowedOrigin.replace(".", "\\.").replace("*", ".*")));
                else
                    allowedOriginsVerbatim.add(allowedOrigin);
            }
        }
        return new CorsLogic(false, allowedOriginsVerbatim, allowedOriginPatterns);
    }
@Test
    void wildcard_matches_everything() {
        CorsLogic logic = CorsLogic.forAllowedOrigins(List.of("*"));
        assertMatches(logic, true, "http://any.origin", "https://any.origin", "http://any.origin:8080");
    }