@Test public void select() { Interval interval = Interval.fromTo(10, -10).by(-5); MutableList<Integer> expected = FastList.newListWith(10, 0, -10); Assert.assertEquals(expected, interval.select(IntegerPredicates.isEven()).toList()); Assert.assertEquals( expected, interval.select(IntegerPredicates.isEven(), FastList.<Integer>newList())); }
@Test public void selectOnFromToInterval() { Interval interval = Interval.oneTo(5); Assert.assertEquals( FastList.newListWith(2, 4), interval.select(IntegerPredicates.isEven()).toList()); Assert.assertEquals( FastList.newListWith(4, 2), interval.reverseThis().select(IntegerPredicates.isEven()).toList()); }