Example usage for org.apache.commons.collections4 CollectionUtils find

List of usage examples for org.apache.commons.collections4 CollectionUtils find

Introduction

In this page you can find the example usage for org.apache.commons.collections4 CollectionUtils find.

Prototype

@Deprecated
public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) 

Source Link

Document

Finds the first element in the given collection which matches the given predicate.

Usage

From source file:org.waastad.javaeeangular.controller.ApplicationBean.java

private Customer findCustomer(List<Customer> list, final Integer id) {
    return CollectionUtils.find(list, new Predicate<Customer>() {

        @Override//from ww  w  . j  a v a  2s . c  o  m
        public boolean evaluate(Customer t) {
            return t.getId().equals(id);
        }
    });
}