Select specific element(s) from a collection

top(collection, value) -  Returns the element having maximum value in the given collection.

Example:  Person person = top( people, p -> p.age );

Here we get the oldest person from the people collection. If the collection is empty, the function returns null.

List filter(collection, condition) - Returns a subset of a given collection - a new list with elements from the original collection which meet the given condition.

Examples:  List women = filter( people, p -> p.gender == FEMALE );

          List idleTrucks = filter( trucks, t -> t.inState(Idle) );

List findAll(collection, condition) - This function is the same as filter(collection, condition).

findFirst(collection, condition) - Returns the first element from the given collection which meets the given condition (the element which has true value of the given condition). Returns null if there is no such element or the collection is empty.

Example:  Person person = findFirst( people, p -> p.age > 20 );