// Path: src/main/java/com/codepoetics/protonpack/collectors/CollectorUtils.java
// public static <T> BinaryOperator<T> noCombiner() {
//     return (t1, t2) -> {
//         throw new UnsupportedOperationException("No combiner supplied for merging parallel results");
//     };
// }


import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.IntStream;
import static com.codepoetics.protonpack.collectors.CollectorUtils.noCombiner;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
package com.codepoetics.protonpack;




public class NoCombinerTest {

    @Test(expected = UnsupportedOperationException.class) public void
    throws_illegal_state_exception_when_called() {
        Long sum = IntStream.range(0, 10000).parallel().mapToObj(Long::valueOf).reduce(0L, (l1, l2) -> l1 + l2, noCombiner());
    }

    @Test public void
    is_never_called_for_sequential_stream() {
        Long sum = IntStream.range(0, 10000).mapToObj(Long::valueOf).reduce(0L, (l1, l2) -> l1 + l2, noCombiner());
    }

    @Test public void
    can_be_used_in_a_collector() {
        assertThat(
// Path: src/main/java/com/codepoetics/protonpack/collectors/CollectorUtils.java
// public static <T> BinaryOperator<T> noCombiner() {
//     return (t1, t2) -> {
//         throw new UnsupportedOperationException("No combiner supplied for merging parallel results");
//     };
// }


// Path: src/test/java/com/codepoetics/protonpack/NoCombinerTest.java
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.IntStream;
import static com.codepoetics.protonpack.collectors.CollectorUtils.noCombiner;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

package com.codepoetics.protonpack;




public class NoCombinerTest {

    @Test(expected = UnsupportedOperationException.class) public void
    throws_illegal_state_exception_when_called() {
        Long sum = IntStream.range(0, 10000).parallel().mapToObj(Long::valueOf).reduce(0L, (l1, l2) -> l1 + l2, noCombiner());
    }

    @Test public void
    is_never_called_for_sequential_stream() {
        Long sum = IntStream.range(0, 10000).mapToObj(Long::valueOf).reduce(0L, (l1, l2) -> l1 + l2, noCombiner());
    }

    @Test public void
    can_be_used_in_a_collector() {
        assertThat(
                IntStream.range(0, 10000).mapToObj(Long::valueOf).collect(Collector.of(HashSet<Long>::new, Set::add, noCombiner())).size(),