diff --git a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java index e4b29c82e..a9d8310c4 100644 --- a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java @@ -807,7 +807,6 @@ public class BooleanUtilsTest { assertTrue( BooleanUtils.or(new boolean[] { false, true, true }), "False result for (false, true, true)"); - } @Test @@ -824,6 +823,20 @@ public class BooleanUtilsTest { public void testXor_object_nullInput() { assertThrows(NullPointerException.class, () -> BooleanUtils.xor((Boolean[]) null)); } + + @Test + public void testXor_object_validInput_1items() { + assertEquals( + true, + BooleanUtils.xor(new Boolean[] { Boolean.TRUE }).booleanValue(), + "true"); + + assertEquals( + false, + BooleanUtils.xor(new Boolean[] { Boolean.FALSE }).booleanValue(), + "false"); + } + @Test public void testXor_object_validInput_2items() { assertEquals( @@ -943,6 +956,19 @@ public class BooleanUtilsTest { assertThrows(NullPointerException.class, () -> BooleanUtils.xor((boolean[]) null)); } + @Test + public void testXor_primitive_validInput_1items() { + assertEquals( + true, + BooleanUtils.xor(new boolean[] { true }), + "true"); + + assertEquals( + false, + BooleanUtils.xor(new boolean[] { false }), + "false"); + } + @Test public void testXor_primitive_validInput_2items() { assertEquals(