### Question:
Streams { public static <T> int count(@NotNull Collection<T> collection, @NotNull Predicate<T> predicate) { AtomicInteger atomicInteger = new AtomicInteger(); for (T t : collection) { if (predicate.test(t)) { atomicInteger.getAndIncrement(); } } return atomicInteger.get(); } private  Streams(); @NotNull static List<String> toLowerCase(@NotNull Collection<String> list); @NotNull static List<T> newList(@NotNull Collection<T> in); @NotNull static SortedSet<T> copySortedSet(@NotNull SortedSet<T> set); @NotNull static List<F> apply(@NotNull List<T> in, @NotNull Function<T, F> function); @Nullable static T filter(@NotNull Collection<T> in, @NotNull Predicate<T> predicate); @NotNull static ReferencedOptional<T> filterToReference(@NotNull Collection<T> in, @NotNull Predicate<T> predicate); @NotNull static ReferencedOptional<V> filterToReference(@NotNull Map<K, V> in, @NotNull Predicate<K> predicate); @Nullable static F filterAndApply(@NotNull Collection<T> in, @NotNull Predicate<T> predicate, @NotNull Function<T, F> function); @NotNull static List<T> getValues(@NotNull Map<F, T> in, @NotNull Predicate<F> predicate); static void forEachValues(@NotNull Map<?, T> map, @NotNull Consumer<T> consumer); static void forEach(@NotNull List<F> list, @NotNull Consumer<F> consumer); @NotNull static List<X> keyApply(@NotNull Map<F, ?> map, @NotNull Function<F, X> fxFunction); @NotNull @SafeVarargs static Collection<F> newCollection(@NotNull Function<S, F> function, S... in); @NotNull static Collection<F> newCollection(@NotNull Collection<S> in, @NotNull Function<S, F> function); @NotNull static Collection<F> newCollection(@NotNull Collection<S> in, @NotNull Predicate<S> predicate, @NotNull Function<S, F> function); @NotNull static List<T> list(@NotNull Collection<T> list, @NotNull Predicate<T> predicate); @NotNull static Collection<T> others(@NotNull Collection<T> list, @NotNull Predicate<T> predicate); @NotNull static Collection<T> allOf(@NotNull Collection<T> collection, @NotNull Predicate<T> predicate); @NotNull static Collection<F> apply(@NotNull Collection<T> collection, @NotNull Function<T, F> function); @NotNull static Collection<T> fromIterator(@NotNull Iterator<T> iterator); @NotNull static T[] concat(@NotNull T[] first, @NotNull T[] second); static int count(@NotNull Collection<T> collection, @NotNull Predicate<T> predicate); @NotNull static Collection<O> map(@NotNull Collection<I> collection, @NotNull Function<I, O> mapper); @NotNull static Collection<O> map(@NotNull I[] collection, @NotNull Function<I, O> mapper); static boolean hasMatch(@NotNull Collection<T> collection, @NotNull Predicate<T> predicate);  }### Answer:
@Test void testCount() { int count = Streams.count(Arrays.asList("test1", "test2", "test3", "ok"), s -> s.startsWith("test")); Assertions.assertEquals(3, count); }