protected void assertArrayHasLengthAndAllElementsNotNull ( final Object [ ] array , final Integer length ) throws ArgumentCountException , ArgumentNullException { if ( array . length != length ) { throw ArgumentCountException . notEqual ( array . length , length ) ; } for ( final Object element : array ) { if ( element == null ) { throw new ArgumentNullException ( ) ; } } }
Test if the given object array has exact the given length and all its elements are not null .