### Question:
MyLanguageServerImpl implements LanguageServer { @Override public void initialized(@Nullable InitializedParams params) { watchingService.watchConfigurationChange(); watchingService.watchPredefinedFolder(); addLocalFilesWatcher(); } @Inject  MyLanguageServerImpl(
      TextDocumentService textService,
      WorkspaceService workspaceService,
      WatcherService watchingService,
      SettingsService settingsService); @Override TextDocumentService getTextDocumentService(); @Override WorkspaceService getWorkspaceService(); @Override @Nonnull CompletableFuture<InitializeResult> initialize(@Nonnull InitializeParams params); @Override void initialized(@Nullable InitializedParams params); @Override CompletableFuture<Object> shutdown(); @Override void exit();  }### Answer:
@Test void initialized() { SettingsService settingsService = mock(SettingsServiceImpl.class); WatcherService watchingService = mock(WatcherService.class); JsonArray arr = new JsonArray(); String path = "foo/bar"; arr.add(new JsonPrimitive(path)); when(settingsService.getConfiguration(LOCAL_PATHS.label)) .thenReturn(completedFuture(singletonList(arr))); when(settingsService.toStrings(any())).thenCallRealMethod(); MyLanguageServerImpl server = new MyLanguageServerImpl(null, null, watchingService, settingsService); server.initialized(new InitializedParams()); verify(watchingService).watchConfigurationChange(); verify(watchingService).watchPredefinedFolder(); verify(settingsService).getConfiguration(LOCAL_PATHS.label); verify(watchingService).addWatchers(singletonList(path)); }