CorsConfig { public static Builder withOrigin(final String origin) { if ("*".equals(origin)) { return new Builder(); } return new Builder(origin); } private  CorsConfig(final Builder builder); boolean isCorsSupportEnabled(); boolean isAnyOriginSupported(); String origin(); Set<String> origins(); boolean isNullOriginAllowed(); Set<String> exposedHeaders(); boolean isCredentialsAllowed(); long maxAge(); Set<HttpMethod> allowedRequestMethods(); Set<String> allowedRequestHeaders(); HttpHeaders preflightResponseHeaders(); boolean isShortCurcuit(); @Override String toString(); static Builder withAnyOrigin(); static Builder withOrigin(final String origin); static Builder withOrigins(final String... origins);  }
@Test (expected = IllegalArgumentException.class) public void shouldThrowIfValueIsNull() { withOrigin("*").preflightResponseHeader("HeaderName", new Object[]{null}).build(); }