@SuppressWarnings("unchecked") @Override public boolean areEqual(Object actual, Object other) { if (actual == null && other == null) return true; if (actual == null || other == null) return false; // expecting actual and other to be iterable<T> return actual instanceof Iterable && other instanceof Iterable && compareElementsOf((Iterable<T>) actual, (Iterable<T>) other); }
/** * {@inheritDoc} */ @Override @CheckReturnValue public SELF usingElementComparator(Comparator<? super ELEMENT> elementComparator) { this.iterables = new Iterables(new ComparatorBasedComparisonStrategy(elementComparator)); // to have the same semantics on base assertions like isEqualTo, we need to use an iterable comparator comparing // elements with elementComparator parameter objects = new Objects(new IterableElementComparisonStrategy<>(elementComparator)); return myself; }
/** * {@inheritDoc} */ @Override @CheckReturnValue public SELF usingElementComparator(Comparator<? super ELEMENT> elementComparator) { this.iterables = new Iterables(new ComparatorBasedComparisonStrategy(elementComparator)); // to have the same semantics on base assertions like isEqualTo, we need to use an iterable comparator comparing // elements with elementComparator parameter objects = new Objects(new IterableElementComparisonStrategy<>(elementComparator)); return myself; }
/** * {@inheritDoc} */ @Override public S usingElementComparator(Comparator<? super T> elementComparator) { this.iterables = new Iterables(new ComparatorBasedComparisonStrategy(elementComparator)); // to have the same semantics on base assertions like isEqualTo, we need to use an iterable comparator comparing // elements with elementComparator parameter objects = new Objects(new IterableElementComparisonStrategy<T>(elementComparator)); return myself; }
@SuppressWarnings("unchecked") @Override public boolean areEqual(Object actual, Object other) { if (actual == null && other == null) return true; if (actual == null || other == null) return false; // expecting actual and other to be iterable<T> return actual instanceof Iterable && other instanceof Iterable && compareElementsOf((Iterable<T>) actual, (Iterable<T>) other); }
@SuppressWarnings("unchecked") @Override public boolean areEqual(Object actual, Object other) { if (actual == null && other == null) return true; if (actual == null || other == null) return false; // expecting actual and other to be iterable<T> return actual instanceof Iterable && other instanceof Iterable && compareElementsOf((Iterable<T>) actual, (Iterable<T>) other); }