public FibonacciHeap union(final FibonacciHeap heap1, final FibonacciHeap heap2) {
		final FibonacciHeap heap = new FibonacciHeap();
		if ((heap1 != null) && (heap2 != null)) {
			heap.min = heap1.min;
			if (heap.min != null) {
				if (heap2.min != null) {
					heap.min.right.left = heap2.min.left;
					heap2.min.left.right = heap.min.right;
					heap.min.right = heap2.min;
					heap2.min.left = heap.min;
					if (heap2.min.cost < heap1.min.cost) {
						heap.min = heap2.min;
					}
				}
			} else {
				heap.min = heap2.min;
			}
			heap.n = heap1.n + heap2.n;
		}
		return heap;
	}