public void testEventDispatchedWithComponentShown()
     throws InterruptedException, InvocationTargetException {
   int listenerCount = documentListenerCount();
   JTextField textField = textField();
   HierarchyEvent event =
       new HierarchyEvent(
           textField,
           HierarchyEvent.DISPLAYABILITY_CHANGED,
           textField,
           new JPanel(),
           HierarchyEvent.SHOWING_CHANGED);
   recorder.eventDispatched(event);
   recorder.componentHidden(textField);
   assertEquals(listenerCount, documentListenerCount());
 }
 public void testRemovesListenerWhenTabbedPaneIsHidden() {
   int listenerCount = documentListenerCount();
   recorder.componentShown(textField);
   recorder.componentHidden(textField);
   assertEquals(listenerCount, documentListenerCount());
 }