public FlowAnyMatch<B> any(Filter<B> filter) { return then(new FlowAnyMatch<B>(filter)); }
@Override public void process(T t) { if (filter.allow(t)) { stop(result = Boolean.TRUE); } } }
@Test public void test_any() { Assert.assertTrue(Flow.of(1, 2, 3).any(new Filter<Integer>() { @Override public boolean allow(Integer integer) { return integer % 2 == 0; } }).get()); Assert.assertFalse(Flow.of(1, 3, 5).any(new Filter<Integer>() { @Override public boolean allow(Integer integer) { return integer % 2 == 0; } }).get()); }
@Override public void process(T t) { if (filter.allow(t)) { stop(result = Boolean.TRUE); } } }
public FlowAnyMatch<B> any(Filter<B> filter) { return then(new FlowAnyMatch<B>(filter)); }