public static void main(String[] args) {
    Random rnd = new Random();
    for (int times = 0; times < 10000; ++times) {
      node_t<Integer> F = null;
      node_t<Integer> L = null;
      int n, m;
      if (args.length == 2) {
        n = Integer.parseInt(args[0]);
        m = Integer.parseInt(args[1]);
      } else if (args.length == 1) {
        n = Integer.parseInt(args[0]);
        m = Integer.parseInt(args[0]);
      } else {
        n = rnd.nextInt(100);
        m = rnd.nextInt(100);
      }
      for (int i = n; i > 0; --i) {
        node_t<Integer> temp = new node_t<Integer>(i, null);
        temp.next = F;
        F = temp;
      }
      for (int j = m; j > 0; --j) {
        node_t<Integer> temp = new node_t<Integer>(j, null);
        temp.next = L;
        L = temp;
      }

      node_t<Integer> sorted_head = merge_sorted_linked_lists(F, L);
      int count = 0;
      int pre = Integer.MIN_VALUE;
      while (sorted_head != null) {
        assert (pre <= sorted_head.data);
        pre = sorted_head.data;
        sorted_head = sorted_head.next;
        ++count;
      }
      // Make sure the merged list have the same number of nodes as F and L.
      assert (count == n + m);
    }
  }