MyVcsActivator () { Set<AbstractVcs> newVcses = !myProject.isDisposed() && TrustedProjects.isTrusted(myProject) ? ContainerUtil.map2SetNotNull(myMappings, this::getMappingsVcs) : Collections.emptySet(); List<AbstractVcs> oldVcses = myActiveVcses; myActiveVcses = List.copyOf(newVcses); refreshMainMenu(); Collection<AbstractVcs> toAdd = ContainerUtil.subtract(myActiveVcses, oldVcses); Collection<AbstractVcs> toRemove = ContainerUtil.subtract(oldVcses, myActiveVcses); return new MyVcsActivator(toAdd, toRemove); }