private void validateArrays(int[] array1, int[] array2) {
    if (array1 == null || array2 == null) {
      throw new IllegalArgumentException("You can't use null arrays as parameters.");
    }
  }
The complexity order of this algorithm in space terms is O(N+M) where N is the length of the
first array and M is the length of the second array. In time terms the complexity order is
equivalent, because we are going to iterate over array1 and array2 to merge every element.
src/main/java/com/github/pedrovgs/problem6/MergeSortedArrays.java