public void testRemovesInternalFrameListenerWhenFrameIsHidden() {
   JInternalFrame internalFrame = new JInternalFrame("title");
   int initialListenerCount = internalFrameListenerCount(internalFrame);
   mockRecorder.expects(once()).method("record").with(eq(new InternalFrameShownEvent("title")));
   recorder.componentShown(internalFrame);
   recorder.componentHidden(internalFrame);
   assertEquals(initialListenerCount, internalFrameListenerCount(internalFrame));
 }