--- old/src/share/classes/java/lang/Long.java 2012-12-05 13:04:01.267420607 -0800 +++ new/src/share/classes/java/lang/Long.java 2012-12-05 13:04:01.095420615 -0800 @@ -1539,6 +1539,48 @@ ((i >>> 16) & 0xffff0000L) | (i >>> 48); } + /** + * Adds two {@code long} values together as per the + operator. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Long>} or {@code LongBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the sum of {@code a} and {@code b}. + * @since 1.8 + */ + public static long sum(long a, long b) { + return a + b; + } + + /** + * Returns the greater of two {@code long} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Long>} or {@code LongBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + * @since 1.8 + */ + public static long max(long a, long b) { + return Math.max(a, b); + } + + /** + * Returns the lesser of two {@code long} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Long>} or {@code LongBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the lesser of {@code a} and {@code b}. + * @since 1.8 + */ + public static long min(long a, long b) { + return Math.min(a, b); + } + /** use serialVersionUID from JDK 1.0.2 for interoperability */ private static final long serialVersionUID = 4290774380558885855L; }