@Test public void allSatisfyWithOver100() { ArrayList<Integer> list = new ArrayList<Integer>(Interval.oneTo(101)); Assert.assertTrue( ArrayListIterate.allSatisfyWith(list, Predicates2.instanceOf(), Integer.class)); Predicate2<Integer, Integer> greaterThanPredicate = Predicates2.greaterThan(); Assert.assertFalse(ArrayListIterate.allSatisfyWith(list, greaterThanPredicate, 2)); }
@Test public void allSatisfyWith() { ArrayList<Integer> list = this.getIntegerList(); Assert.assertTrue( ArrayListIterate.allSatisfyWith(list, Predicates2.instanceOf(), Integer.class)); Predicate2<Integer, Integer> greaterThanPredicate = Predicates2.greaterThan(); Assert.assertFalse(ArrayListIterate.allSatisfyWith(list, greaterThanPredicate, 2)); }