protected void assertActiveBytesAfter(DocumentsWriterFlushControl flushControl) {
   Iterator<ThreadState> allActiveThreads = flushControl.allActiveThreadStates();
   long bytesUsed = 0;
   while (allActiveThreads.hasNext()) {
     bytesUsed += allActiveThreads.next().dwpt.bytesUsed();
   }
   assertEquals(bytesUsed, flushControl.activeBytes());
 }
 static void findPending(
     DocumentsWriterFlushControl flushControl,
     ArrayList<ThreadState> pending,
     ArrayList<ThreadState> notPending) {
   Iterator<ThreadState> allActiveThreads = flushControl.allActiveThreadStates();
   while (allActiveThreads.hasNext()) {
     ThreadState next = allActiveThreads.next();
     if (next.flushPending) {
       pending.add(next);
     } else {
       notPending.add(next);
     }
   }
 }