@@ -0,0 +1,2560 @@
+/*%0A * Copyright 2019 Immutables Authors and Contributors%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *  http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.immutables.check;%0A%0Aimport java.util.List;%0Aimport java.util.Objects;%0Aimport java.util.stream.Collectors;%0Aimport java.util.stream.Stream;%0A%0A/**%0A * Similar check to %7B@link IterableChecker%7D but on streams.%0A *%0A * Currently resides in criteria-common because %7B@code testing%7D module is still oon Java 7.%0A */%0Apublic class StreamChecker%3CZ extends Stream%3CT%3E, T%3E %7B%0A%0A  private final Stream%3CT%3E stream;%0A  private IterableChecker%3CList%3CT%3E, T%3E delegate; // lazy%0A%0A  private StreamChecker(Stream%3CT%3E stream) %7B%0A    this.stream = Objects.requireNonNull(stream, %22stream%22);%0A  %7D%0A%0A  /**%0A   * Lazily instantiate %7B@link IterableChecker%7D%0A   */%0A  private IterableChecker%3CList%3CT%3E, T%3E lazyGet() %7B%0A    IterableChecker%3CList%3CT%3E, T%3E delegate = this.delegate;%0A    if (delegate == null) %7B%0A      List%3CT%3E asList = stream.collect(Collectors.toList());%0A      delegate = new IterableChecker%3C%3E(stream.collect(Collectors.toList()), false);%0A      this.delegate = delegate;%0A    %7D%0A%0A    return delegate;%0A  %7D%0A%0A  public void has(T element) %7B%0A    lazyGet().has(element);%0A  %7D%0A%0A  @SafeVarargs%0A  public final void hasAll(T... elements) %7B%0A    lazyGet().hasAll(elements);%0A  %7D%0A%0A  public final void hasAll(Iterable%3C? extends T%3E elements) %7B%0A    lazyGet().hasAll(elements);%0A  %7D%0A%0A  public void isOf(Iterable%3C?%3E elements) %7B%0A    lazyGet().isOf(elements);%0A  %7D%0A%0A  @SafeVarargs%0A  public final void isOf(T... elements) %7B%0A    lazyGet().isOf(elements);%0A  %7D%0A%0A  public void hasContentInAnyOrder(Iterable%3C? extends T%3E elements) %7B%0A    lazyGet().hasContentInAnyOrder(elements);%0A  %7D%0A%0A  @SafeVarargs%0A  public final void hasContentInAnyOrder(T... elements) %7B%0A    lazyGet().hasContentInAnyOrder(elements);%0A  %7D%0A%0A  public void hasSize(int size) %7B%0A    lazyGet().hasSize(size);%0A  %7D%0A%0A  public void notEmpty() %7B%0A    lazyGet().notEmpty();%0A  %7D%0A%0A  public void isEmpty() %7B%0A    lazyGet().isEmpty();%0A  %7D%0A%0A  public static %3CT%3E StreamChecker%3CStream%3CT%3E, T%3E of(Stream%3CT%3E stream) %7B%0A    return new StreamChecker%3C%3E(stream);%0A  %7D%0A%0A%7D%0A

Add StreamChecker for tests