BuildProjectConsoleMode extends BuildProjectCommandMode { @Override public void execute() throws Exception { initialize(); startConsoleServer(); this.build(project); builder.getResourceManager().addResourceChangeListener(this::resourceChanged); createFileWatcher(); }  void addListener(final DangerousConsumer<BuildDetails> listener); @Override void execute();  }
@Test public void testExecute() throws Exception { final FileWatcher fileWatcher = mock(FileWatcher.class); whenNew(FileWatcher.class).withAnyArguments().thenReturn(fileWatcher); buildProject.execute(); }