public static <T> node_t<T> overlapping_lists(node_t<T> L1,
                                          node_t<T> L2) {
    // Store the start of cycle if any.
    node_t<T> s1 = CheckingCycle.has_cycle(L1), s2 = CheckingCycle.has_cycle(L2);
  
    if (s1 == null && s2 == null) {
      return OverlappingListsNoCycle.overlapping_no_cycle_lists(L1, L2);
    } else if (s1 != null && s2 != null) {  // both lists have cycles.
      node_t<T> temp = s2;
      do {
        temp = temp.next;
      } while (temp != s1 && temp != s2);
      return (temp == s1) ? s1 : null;
    }
    return null;  // one list has cycle, and one list has no cycle.
  }