@Override public boolean allSatisfy(Predicate<? super T> predicate) { return ArrayIterate.allSatisfy(this.elements, predicate); }
@Override public boolean allSatisfy(Predicate<? super T> predicate) { return ArrayIterate.allSatisfy(this.keys, predicate); }
@Override public boolean containsAllArguments(Object... elements) { return ArrayIterate.allSatisfy(elements, Predicates.equal(this.value)); }
public static void assertContainsAll( String collectionName, final Iterable<?> iterable, Object... items) { try { Verify.assertObjectNotNull(collectionName, iterable); Verify.assertNotEmpty("Expected items in assertion", items); Predicate<Object> containsPredicate = new Predicate<Object>() { public boolean accept(Object each) { return Iterate.contains(iterable, each); } }; if (!ArrayIterate.allSatisfy(items, containsPredicate)) { ImmutableList<Object> result = Lists.immutable.of(items).newWithoutAll(iterable); Assert.fail(collectionName + " did not contain these items" + ":<" + result + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }
@Override public boolean allSatisfy(Predicate<? super T> predicate) { return ArrayIterate.allSatisfy(this.elements, predicate); }
@Override public boolean allSatisfy(Predicate<? super T> predicate) { return ArrayIterate.allSatisfy(this.keys, predicate); }
@Override public boolean containsAllArguments(Object... elements) { return ArrayIterate.allSatisfy(elements, Predicates.equal(this.value)); }
public static void assertContainsAll( String collectionName, final Iterable<?> iterable, Object... items) { try { Verify.assertObjectNotNull(collectionName, iterable); Verify.assertNotEmpty("Expected items in assertion", items); Predicate<Object> containsPredicate = new Predicate<Object>() { public boolean accept(Object each) { return Iterate.contains(iterable, each); } }; if (!ArrayIterate.allSatisfy(items, containsPredicate)) { ImmutableList<Object> result = Lists.immutable.of(items).newWithoutAll(iterable); Assert.fail(collectionName + " did not contain these items" + ":<" + result + '>'); } } catch (AssertionError e) { Verify.throwMangledException(e); } }