diff --git a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java index 91b86c3d6..a3286b329 100644 --- a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java @@ -6121,6 +6121,28 @@ public class ArrayUtilsTest extends AbstractLangTest { assertEquals(3, array[2]); } + @Test + public void testTextIndexesOfInt() { + int[] array = null; + final BitSet emptySet = new BitSet(); + final BitSet testSet = new BitSet(); + assertEquals(emptySet, ArrayUtils.indexesOf(array, 0)); + array = new int[]{0, 1, 2, 3, 0}; + testSet.set(0); + testSet.set(4); + assertEquals(testSet, ArrayUtils.indexesOf(array, 0)); + testSet.clear(); + testSet.set(1); + assertEquals(testSet, ArrayUtils.indexesOf(array, 1)); + testSet.clear(); + testSet.set(2); + assertEquals(testSet, ArrayUtils.indexesOf(array, 2)); + testSet.clear(); + testSet.set(3); + assertEquals(testSet, ArrayUtils.indexesOf(array, 3)); + assertEquals(emptySet, ArrayUtils.indexesOf(array, 99)); + } + @Test public void testToMap() { Map map = ArrayUtils.toMap(new String[][]{{"foo", "bar"}, {"hello", "world"}}); @@ -6559,26 +6581,4 @@ public class ArrayUtilsTest extends AbstractLangTest { assertArrayEquals(new String[]{"1", "valueForNullElements", "test"}, ArrayUtils.toStringArray(array, "valueForNullElements")); } - - @Test - public void textIndexesOfInt() { - int[] array = null; - final BitSet emptySet = new BitSet(); - final BitSet testSet = new BitSet(); - assertEquals(emptySet, ArrayUtils.indexesOf(array, 0)); - array = new int[]{0, 1, 2, 3, 0}; - testSet.set(0); - testSet.set(4); - assertEquals(testSet, ArrayUtils.indexesOf(array, 0)); - testSet.clear(); - testSet.set(1); - assertEquals(testSet, ArrayUtils.indexesOf(array, 1)); - testSet.clear(); - testSet.set(2); - assertEquals(testSet, ArrayUtils.indexesOf(array, 2)); - testSet.clear(); - testSet.set(3); - assertEquals(testSet, ArrayUtils.indexesOf(array, 3)); - assertEquals(emptySet, ArrayUtils.indexesOf(array, 99)); - } }