This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push: new 44f62a10e Add test 44f62a10e is described below commit 44f62a10e60de4e6ec86f386ad782ecc8f896f69 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun May 12 14:26:43 2024 -0400 Add test --- src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java index 017d4479b..ca7658b60 100644 --- a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java @@ -36,7 +36,9 @@ import java.util.Comparator; import java.util.Date; import java.util.Map; import java.util.Random; +import java.util.function.Supplier; +import org.apache.commons.lang3.function.Suppliers; import org.junit.jupiter.api.Test; /** @@ -69,6 +71,14 @@ public class ArrayUtilsTest extends AbstractLangTest { assertFalse(ArrayUtils.isEquals(array2, array1)); } + @Test + public void testArraycopy() { + String[] arr = { "a", "b" }; + assertThrows(NullPointerException.class, () -> ArrayUtils.arraycopy(null, 0, 0, 1, () -> new String[3])); + assertThrows(NullPointerException.class, () -> ArrayUtils.arraycopy(arr, 0, 0, 1, Suppliers.nul())); + assertThrows(NullPointerException.class, () -> ArrayUtils.arraycopy(arr, 0, 0, 1, (Supplier<String[]>) null)); + } + /** * Tests generic array creation with parameters of same type. */