/*
 * Copyright (c) 2015-2019 Dzikoysk
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.panda_lang.panda.utilities.commons;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class ArrayUtilsTest {

    private static final String[] EMPTY_ARRAY = new String[] { };

    private static final String[] ARRAY = new String[] { "a", "b", "c" };

    private static final String[] ARRAY_WITH_NULL = new String[] { "a", "b", "c", null };

    @Test
    public void testContainsNull() {
        Assertions.assertAll(
                () -> Assertions.assertTrue(ArrayUtils.containsNull(ARRAY_WITH_NULL)),

                () -> Assertions.assertFalse(ArrayUtils.containsNull(ARRAY)),
                () -> Assertions.assertFalse(ArrayUtils.containsNull(EMPTY_ARRAY))
        );
    }

    @Test
    public void testContains() {
        Assertions.assertAll(
                () -> Assertions.assertTrue(ArrayUtils.contains(ARRAY, "b")),

                () -> Assertions.assertFalse(ArrayUtils.contains(EMPTY_ARRAY, "d")),
                () -> Assertions.assertFalse(ArrayUtils.contains(ARRAY_WITH_NULL, "d"))
        );
    }

    @Test
    public void testGet() {
        Assertions.assertAll(
                () -> Assertions.assertNotNull(ArrayUtils.get(ARRAY, 0)),
                () -> Assertions.assertNotNull(ArrayUtils.get(ARRAY, 2)),

                () -> Assertions.assertNull(ArrayUtils.get(ARRAY, -1)),
                () -> Assertions.assertNull(ArrayUtils.get(ARRAY, 3))
        );
    }

    @Test
    public void testDimensionalArrayClass() {
        Assertions.assertAll(
                () -> Assertions.assertEquals(Object[][].class, ArrayUtils.getDimensionalArrayType(Object.class, 3)),
                () -> Assertions.assertThrows(IllegalArgumentException.class, () -> ArrayUtils.getDimensionalArrayType(Object.class, 0))
        );
    }

}

@@ -992,33 +992,22 @@
 est%0A    
-public void testC
+void c
 ontainsN
@@ -1329,25 +1329,14 @@
     
-public void testC
+void c
 onta
@@ -1661,25 +1661,749 @@
     
-public void testG
+void mergeArrays() %7B%0A        Assertions.assertArrayEquals(new String%5B%5D %7B%0A                %22a%22, %22b%22, %22c%22,%0A                %22a%22, %22b%22, %22c%22, null%0A        %7D, ArrayUtils.mergeArrays(ARRAY, ARRAY_WITH_NULL));%0A    %7D%0A%0A    @Test%0A    void isEmpty() %7B%0A        Assertions.assertTrue(ArrayUtils.isEmpty(EMPTY_ARRAY));%0A    %7D%0A%0A    @Test%0A    void getArrayClass() %7B%0A        Assertions.assertEquals(String%5B%5D.class, ArrayUtils.getArrayClass(String.class));%0A    %7D%0A%0A    @Test%0A    void getDimensionalArrayType() %7B%0A        Assertions.assertEquals(String%5B%5D.class, ArrayUtils.getDimensionalArrayType(String.class, 2));%0A    %7D%0A%0A    @Test%0A    void of() %7B%0A        Assertions.assertArrayEquals(new String%5B%5D %7B %22a%22, %22b%22 %7D, ArrayUtils.of(%22a%22, %22b%22));%0A    %7D%0A%0A    @Test%0A    void g
 et()
@@ -2762,25 +2762,14 @@
     
-public void testD
+void d
 imen

Improve unit tests for ArrayUtils