62,635
社区成员




default Predicate<T> and(Predicate<? super T> other) {
Objects.requireNonNull(other);
//为什么能够返回Predicate类型的对象
return (t) -> test(t) && other.test(t);
}
return (t) -> (test(t) && other.test(t));
default Predicate<T> and(Predicate<? super T> other) {
Objects.requireNonNull(other);
//return (t) -> test(t) && other.test(t);
return new Predicate<T>(){
@Override
public boolean test(T t) {
// TODO Auto-generated method stub
return this.test(t) && other.test(t);
}
};
}
default Predicate<T> and(Predicate<T> other) {
Objects.requireNonNull(other);
//为什么能够返回Predicate类型的对象
//return (t) -> test(t) && other.test(t);
return new Predicate(){
@Override
public boolean test(Object o) {
return this.test(o) && other.test(o);
}
};
}