Index: lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java
===================================================================
--- lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java	(revision 1079068)
+++ lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java	(working copy)
@@ -31,8 +31,28 @@
         protected boolean lessThan(Integer a, Integer b) {
             return (a < b);
         }
+
+        /**
+         * method that demonstrates direct access of protected "heap" 
+         * array from subclass
+         */
+        public boolean isTopEquals(Object other) {
+          return other.equals(heap[1]);
+        }
     }
 
+  public void testSubClassHeapAccess() throws Exception {
+    IntegerQueue foo = new IntegerQueue(10);
+    foo.add(45);
+    foo.add(67);
+
+    assertFalse("'stuff' equals top of queue", 
+                "stuff".equals(foo.top()));
+
+    assertFalse("subclass says 'stuff' is equal to top",
+                foo.isTopEquals("stuff"));
+  }
+
     public void testPQ() throws Exception {
         testPQ(10000 * RANDOM_MULTIPLIER, random);
     }
