### Question:
FilenameTextField extends AbstractResourceTextField<FileResource> { public void addFileSelectionListener(final FileSelectionListener listener) { _fileSelectionListeners.add(listener); } FilenameTextField(final File directory, final boolean fileOpenDialog); void addFileSelectionListener(final FileSelectionListener listener); void removeSelectionListener(final FileSelectionListener listener); @Override FileResource getResource(); @Override void setResource(final FileResource resource); File getDirectory(); File getFile(); void setFile(final File file);  }### Answer:
@Test public void testDifferentListenersAllGetsNotification() throws Exception { final FilenameTextField filenameTextField = new FilenameTextField(new File("."), true); final AtomicBoolean fileSelectionListenerInvoked = new AtomicBoolean(false); final AtomicBoolean resourceListenerInvoked = new AtomicBoolean(false); filenameTextField .addFileSelectionListener((filenameTextField1, file) -> fileSelectionListenerInvoked.set(true)); filenameTextField.addListener(new ResourceTypePresenter.Listener() { @Override public void onResourceSelected(final ResourceTypePresenter<?> presenter, final Resource resource) { resourceListenerInvoked.set(true); } @Override public void onPathEntered(final ResourceTypePresenter<?> presenter, final String path) { } }); filenameTextField.setFilename("src/foo.txt"); assertTrue(fileSelectionListenerInvoked.get()); assertTrue(resourceListenerInvoked.get()); }