### Question:
FileManager extends AbstractManager implements IFileManager { @Override public ProcessHandle<FileNode> listFiles() throws NoPeerConnectionException, NoSessionException { IProcessComponent<FileNode> component = getH2HFileManager().createFileListProcess(); ProcessHandle<FileNode> handle = new ProcessHandle<FileNode>(component); return handle; } @Inject  FileManager(final INodeManager nodeManager, final UserConfig userConfig); @Override ProcessHandle<Void> add(final Path file); @Override ProcessHandle<Void> update(final Path file); @Override ProcessHandle<Void> delete(final Path file); @Override ProcessHandle<Void> move(final Path source, final Path destination); @Override ProcessHandle<Void> download(final Path file); @Override ProcessHandle<Void> recover(final Path file, final IVersionSelector versionSelector); @Override ProcessHandle<Void> share(final Path folder, final String userId, final PermissionType permission); @Override ProcessHandle<FileNode> listFiles(); @Override boolean existsRemote(final Path path); @Override boolean isSmallFile(final Path path); @Override boolean isLargeFile(final Path path);  }### Answer:
@Test public void testListFiles() throws NoPeerConnectionException, NoSessionException { @SuppressWarnings("unchecked") IProcessComponent<FileNode> listFiles = (IProcessComponent<FileNode>)Mockito.mock(IProcessComponent.class); Mockito.stub(h2hFileManager.createFileListProcess()).toReturn(listFiles); ProcessHandle<FileNode> p = fileManager.listFiles(); assertNotNull(p); assertNotNull(p.getProcess()); assertEquals(listFiles, p.getProcess()); Mockito.verify(h2hFileManager, times(1)).createFileListProcess(); Mockito.verifyNoMoreInteractions(h2hFileManager); }