The result of xor(true, true, true) of the BooleanUtils class under the commons-lang toolkit under Apache is false, but the result of System.out.println(true ^ true ^ true) is true. Why?
public class Test {
public static void main(String[] args) {
System.out.println(org.apache.commons.lang.BooleanUtils.xor(new boolean[]{true, true, true}));
System.out.println(org.apache.commons.lang3.BooleanUtils.xor(new boolean[]{true, true, true}));
System.out.println(true ^ true ^ true);
}
}
/*
result:
false
false
true
*/