public void AssertQueueProperty(PriorityQueue<int> queue)
        {
            Type type = queue.GetType();

            FieldInfo elementsField = type.GetField("_elements", BindingFlags.NonPublic | BindingFlags.Instance);
            int[] elements = (int[])elementsField.GetValue(queue);

            FieldInfo elementsUsedField = type.GetField("_elementsUsed", BindingFlags.NonPublic | BindingFlags.Instance);
            int elementsUsed = (int)elementsUsedField.GetValue(queue);

            for (int i = 1; i < elementsUsed; i++)
            {
                int parent = (i - 1) / 2;

                if (elements[parent] > elements[i])
                {
                    Assert.Fail("Heap property violated.");
                }
            }
        }