BAEL-1035 Introduction to Eclipse Collections (#2425)
* Evaluation article: Different Types of Bean Injection in Spring * added tests & changed configuration to Java-based config * removed xml config files * rename unit tests * BAEL-972 - Apache Commons Text * remove code from evaluation article * remove code from evaluation article * BAEL-972 - Apache Commons Text - added another example * BAEL-972 - Apache Commons Text - just indentation * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java - fix problems * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * fix formatting * BAEL-1033 minor refactor * BAEL-1035 Introduction to Eclipse Collections * format * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * cleanup * cleanup
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
310e89e4f0
commit
9b2e8ec9f9
@@ -1,10 +1,9 @@
|
||||
package com.baeldung.eclipsecollections;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.eclipse.collections.api.LazyIterable;
|
||||
import org.eclipse.collections.api.list.MutableList;
|
||||
import org.eclipse.collections.impl.block.factory.Predicates;
|
||||
import org.eclipse.collections.impl.factory.Lists;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
|
||||
public class LazyIterationTest {
|
||||
@@ -19,8 +18,7 @@ public class LazyIterationTest {
|
||||
LazyIterable<Student> lazyStudents = students.asLazy();
|
||||
LazyIterable<String> lastNames = lazyStudents.collect(Student::getLastName);
|
||||
|
||||
assertTrue(lastNames.anySatisfy(Predicates.equal("Hopkins")));
|
||||
assertTrue(lastNames.anySatisfy(Predicates.equal("Adams")));
|
||||
assertTrue(lastNames.anySatisfy(Predicates.equal("Rodriguez")));
|
||||
Assertions.assertThat(lastNames)
|
||||
.containsAll(Lists.mutable.with("Hopkins", "Adams", "Rodriguez"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user