--- old/src/share/classes/java/lang/Boolean.java 2012-11-29 17:05:20.408723656 -0800 +++ new/src/share/classes/java/lang/Boolean.java 2012-11-29 17:05:20.236723648 -0800 @@ -290,4 +290,49 @@ public static int compare(boolean x, boolean y) { return (x == y) ? 0 : (x ? 1 : -1); } + + /** + * Returns the result of applying the logical AND operator to the + * specified {@code boolean} parameters. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Boolean>}. + * + * @param a a boolean argument. + * @param b another boolean argument. + * @return the logical AND of {@code a} and {@code b}. + * @since 1.8 + */ + public static boolean and(boolean a, boolean b) { + return a && b; + } + + /** + * Returns the result of applying the logical OR operator to the + * specified {@code boolean} parameters. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Boolean>}. + * + * @param a a boolean argument. + * @param b another boolean argument. + * @return the logical OR of {@code a} and {@code b}. + * @since 1.8 + */ + public static boolean or(boolean a, boolean b) { + return a || b; + } + + /** + * Returns the result of applying the logical XOR operator to the + * specified {@code boolean} parameters. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Boolean>}. + * + * @param a a boolean argument. + * @param b another boolean argument. + * @return the logical XOR of {@code a} and {@code b}. + * @since 1.8 + */ + public static boolean xor(boolean a, boolean b) { + return a ^ b; + } }