public void shouldThrowErrorWhenSettingCurrentDirectoryInDisabledJFileChooser() {
   disableFileChooser();
   try {
     driver.setCurrentDirectory(fileChooser, userHomeDirectory());
     failWhenExpectingException();
   } catch (IllegalStateException e) {
     assertActionFailureDueToDisabledComponent(e);
   }
 }
 public void shouldThrowErrorWhenSelectingFileInDisabledJFileChooser() {
   File temporaryFile = newTemporaryFile();
   disableFileChooser();
   try {
     driver.selectFile(fileChooser, temporaryFile);
     failWhenExpectingException();
   } catch (IllegalStateException e) {
     assertActionFailureDueToDisabledComponent(e);
   } finally {
     temporaryFile.delete();
   }
 }