Disposable (@NotNull VcsLogWindow window) { String windowId = window.getId(); if (ContainerUtil.exists(myLogWindows, w -> w.getId().equals(windowId))) { throw new CannotAddVcsLogWindowException("Log window with id '" + windowId + "' was already added. " + "Existing windows:\n" + getLogWindowsInformation(), myCreationTraces.get(windowId)); } myLogWindows.add(window); myCreationTraces.put(windowId, new Throwable("Creation trace for " + window)); refresherActivated(window.getRefresher(), true); return () -> { LOG.debug("Removing disposed log window " + window); myLogWindows.remove(window); myCreationTraces.remove(windowId); }; }