Implement utility methods in a class ArrayUtil that:

Look at the unit test for details.