boolean (long time, @NotNull TimeUnit unit) { final Collection<ExternalJavacProcessHandler> processes; synchronized (myRunningProcesses) { processes = new ArrayList<>(myRunningProcesses.values()); } for (ProcessHandler handler : processes) { if (!handler.waitFor(unit.toMillis(time))) { return false; } } return true; }