import java.util.*; import java.util.function.BiFunction; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; class Test { public static class K { private final T head; private final K tail; public K(T head, K tail) { this.head = head; this.tail = tail; } } public static class P { public P biMap(P that, BiFunction f) { return null; } } public static P> f(K> x) { return x.head.biMap(f(x.tail), K::new); } } class A { public A(Supplier arg0, Supplier> arg1){} static A make(S[] s) { return helpMake(0, s); } static A helpMake(int offset, S[] s) { return new A<>(() -> s[offset], () -> helpMake(offset + 1, s)); } } interface MultivaluedMap extends Map> { void putSingle(K var1, V var2); void add(K var1, V var2); V getFirst(K var1); } class Headers { private final Map> headers; public Headers(Map> headers) { this.headers = headers; } public Headers(MultivaluedMap multimap) { this.headers = multimap.entrySet() .stream() .collect( Collectors.toMap( Map.Entry::getKey, x -> x.getValue() .stream() .map(Object::toString) .collect(Collectors.toList()) ) ); } } class IDEA128245 { public void testCollectors(final Stream>> stream, Stream integerStream) { stream.collect(Collectors.toMap(Map.Entry::getKey, entry -> integerStream.collect(Collectors.toSet()))); } }