class GetTheElementInTheMiddleOfTheList {

  public ListNode<Integer> get2(ListNode<Integer> list) {
    validateInput(list);

    ListNode<Integer> currentNode = list;
    ListNode<Integer> fastNode = list.getNext();
    while (fastNode != null && fastNode.getNext() != null) {
      currentNode = currentNode.getNext();
      fastNode = fastNode.getNext().getNext();
    }
    return currentNode;
  }

}