public static <T> node_t<T> 
  overlapping_no_cycle_lists(node_t<T> L1, node_t<T> L2) {
    // Count the lengths of L1 and L2.
    int L1_len = count_len(L1);
    int L2_len = count_len(L2);

    Ref<node_t<T>> RL1 = new Ref<node_t<T>>(L1);
    Ref<node_t<T>> RL2 = new Ref<node_t<T>>(L2);

    // Advance the longer list.
    advance_list_by_k(L1_len > L2_len ? RL1 : RL2, Math.abs(L1_len - L2_len));

    while (RL1.value != null && RL2.value != null && RL1.value != RL2.value) {
      RL1.value = RL1.value.next;
      RL2.value = RL2.value.next;
    }
    return RL1.value;  // nullptr means no overlap between L1 and L2.
  }