HeaderFilters { public static HeaderFilter eachHeader( final BinaryOperator<String> operator) { return headers -> headers.apply(headers.keySet(), (name, values) -> { final List<String> result = values.stream() .map(value -> operator.apply(name, value)) .collect(toList()); if (result.equals(values)) { return values; } return result; }); } private  HeaderFilters(); @API(status = MAINTAINED) static HeaderFilter defaultValue(); @API(status = MAINTAINED) static HeaderFilter authorization(); static HeaderFilter replaceHeaders(
            final String name,
            final String replacement); static HeaderFilter replaceHeaders(
            final Collection<String> names,
            final String replacement); static HeaderFilter replaceCookies(
            final Predicate<String> predicate, final String replacement); static HeaderFilter replaceHeaders(
            final Predicate<String> keyPredicate,
            final String replacement); static HeaderFilter replaceHeaders(
            final BiPredicate<String, String> predicate,
            final String replacement); static HeaderFilter eachHeader(
            final BinaryOperator<String> operator); static HeaderFilter removeHeaders(
            final String... names); static HeaderFilter removeHeaders(
            final Predicate<String> predicate); static HeaderFilter removeHeaders(
            final BiPredicate<String, String> predicate);  }
@Test void appliesToEachHeader() { final HeaderFilter unit = eachHeader((k, v) -> v.toUpperCase()); final HttpHeaders actual = unit.filter( HttpHeaders.empty() .update("hello", "world") .update("chao", "bambina") .update("already", "UPPERCASE")); final HttpHeaders expected = HttpHeaders.empty() .update("hello", "WORLD") .update("chao", "BAMBINA") .update("already", "UPPERCASE"); assertEquals(expected, actual); }