@Test public void compareEquals() { final Integer value = Integer.valueOf(10); final Predicate<Integer> p = comparatorPredicate(value, new TestComparator<Integer>()); assertFalse(p, Integer.valueOf(value.intValue() - 1)); assertTrue(p, Integer.valueOf(value.intValue())); assertFalse(p, Integer.valueOf(value.intValue() + 1)); }
public static <T> Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator) { return comparatorPredicate(object, comparator, Criterion.EQUAL); }
ComparatorPredicate implements Predicate<T>, Serializable { public static <T> Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator) { return comparatorPredicate(object, comparator, Criterion.EQUAL); } }
ComparatorPredicate implements Predicate<T>, Serializable { public static <T> Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator) { return comparatorPredicate(object, comparator, Criterion.EQUAL); } ComparatorPredicate(final T object, final Comparator<T> comparator, final Criterion criterion); }
ComparatorPredicate implements Predicate<T>, Serializable { public static <T> Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator) { return comparatorPredicate(object, comparator, Criterion.EQUAL); } ComparatorPredicate(final T object, final Comparator<T> comparator, final Criterion criterion); static Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator); static Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator,
                                                       final Criterion criterion); boolean evaluate(final T target); }
ComparatorPredicate implements Predicate<T>, Serializable { public static <T> Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator) { return comparatorPredicate(object, comparator, Criterion.EQUAL); } ComparatorPredicate(final T object, final Comparator<T> comparator, final Criterion criterion); static Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator); static Predicate<T> comparatorPredicate(final T object, final Comparator<T> comparator,
                                                       final Criterion criterion); boolean evaluate(final T target);  }