2017-08-10 16:58:22 +03:00
|
|
|
package com.baeldung.eclipsecollections;
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
|
|
import org.eclipse.collections.api.list.MutableList;
|
|
|
|
|
import org.eclipse.collections.impl.block.factory.Predicates;
|
|
|
|
|
import org.eclipse.collections.impl.list.mutable.FastList;
|
|
|
|
|
import org.junit.Before;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
public class AnySatisfyPatternTest {
|
|
|
|
|
|
|
|
|
|
MutableList<Integer> list;
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
|
public void getList() {
|
2017-08-12 18:42:04 +02:00
|
|
|
this.list = FastList.newListWith(1, 8, 5, 41, 31, 17, 23, 38);
|
2017-08-10 16:58:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void whenAnySatisfiesCondition_thenCorrect() {
|
|
|
|
|
boolean result = list.anySatisfy(Predicates.greaterThan(30));
|
|
|
|
|
|
|
|
|
|
assertTrue(result);
|
|
|
|
|
}
|
|
|
|
|
}
|