Example usage for java.util.function BinaryOperator minBy

List of usage examples for java.util.function BinaryOperator minBy

Introduction

In this page you can find the example usage for java.util.function BinaryOperator minBy.

Prototype

public static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator) 

Source Link

Document

Returns a BinaryOperator which returns the lesser of two elements according to the specified Comparator .

Usage

From source file:Main.java

public static void main(String[] args) {
    BinaryOperator<Integer> bi = BinaryOperator.minBy(Comparator.reverseOrder());
    System.out.println(bi.apply(2, 3));
}