@Test public void collectOnFromToByInterval() { Interval interval = Interval.oneToBy(5, 2); LazyIterable<String> result = interval.collect(String::valueOf); Verify.assertIterableSize(3, result); Verify.assertContainsAll(result, "1", "5"); Verify.assertNotContains("2", result); }
@Test public void forEachOnFromToByInterval2() { List<Integer> result = new ArrayList<>(); Interval interval = Interval.fromToBy(5, 1, -2); interval.forEach(CollectionAddProcedure.on(result)); Verify.assertSize(3, result); Verify.assertContains(1, result); Verify.assertNotContains(2, result); Verify.assertContains(5, result); }