--- old/src/share/classes/java/lang/Character.java 2012-11-29 17:05:22.220723744 -0800 +++ new/src/share/classes/java/lang/Character.java 2012-11-29 17:05:22.056723736 -0800 @@ -7234,4 +7234,46 @@ // should never come here return Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH); } + + /** + * Adds two chars together as per the + operator. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Character>}. + * + * @param a an argument. + * @param b another argument. + * @return the sum of {@code a} and {@code b}. + * @since 1.8 + */ + public static char sum(char a, char b) { + return (char) (a + b); + } + + /** + * Returns the greater of two {@code char} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Character>}. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + * @since 1.8 + */ + public static char max(char a, char b) { + return (a >= b) ? a : b; + } + + /** + * Returns the lesser of two {@code char} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Character>}. + * + * @param a an argument. + * @param b another argument. + * @return the lesser of {@code a} and {@code b}. + * @since 1.8 + */ + public static char min(char a, char b) { + return (a <= b) ? a : b; + } }