public static void atLength ( final Object [ ] array , final int length , final String arrayName ) { notNull ( array , arrayName ) ; notNegative ( length , "length" ) ; if ( array . length != length ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument ( arrayName ) + " to be of length " + length + "." ) ; } }
Checks that an array is of a given length