Here you can find the source of assertArrayLengthEqual(Object[] array, String name, Object[] array1, String name1)
Parameter | Description |
---|---|
array | the given array to check |
array1 | the given array to check |
name | the name to identify array. |
name1 | the name to identify array1. |
Parameter | Description |
---|---|
IllegalArgumentException | if length of array is different from that of array1. |
static void assertArrayLengthEqual(Object[] array, String name, Object[] array1, String name1)
//package com.java2s; public class Main { /**//from w w w .java2s . c o m * Check if the lengths of the two arrays are equal. * @param array * the given array to check * @param array1 * the given array to check * @param name * the name to identify array. * @param name1 * the name to identify array1. * @throws IllegalArgumentException * if length of array is different from that of array1. */ static void assertArrayLengthEqual(Object[] array, String name, Object[] array1, String name1) { if (array.length != array1.length) { throw new IllegalArgumentException("The length of " + name + " should be the same as that of " + name1); } } }