private void validateInput(ListNode list) {
    if (list == null) {
      throw new IllegalArgumentException("You can't pass a null list as parameter.");
    }
  }
Recursive solution to this problem. The complexity order of this algorithm in time terms is
O(N) where N is the number of elements in the list. The complexity order in this algorithm in
space terms is O(1) because we only use two additional pointers and we don't allocate memory.
src/main/java/com/github/pedrovgs/problem22/ReverseLinkedList.java