### Question:
ControlledFileChooser implements FileChooser { @Override public Path getPrintFile() { Path selectedFile = chooser.selectSaveFile(configuration); if (selectedFile == null) { return null; } return selectedFile; } ControlledFileChooser(SingleFileChooser chooser, FileChooserConfiguration configuration); @Override Path getPrintFile();  }### Answer:
@Test public void findsFileViaRegisteredFileChooser() throws Exception { Path expectation = Paths.get("."); SingleFileChooser singleFileChooser = mock(SingleFileChooser.class); when(singleFileChooser.selectSaveFile(configuration)).thenReturn(expectation); assertThat(new ControlledFileChooser(singleFileChooser, configuration).getPrintFile(), is(expectation)); }