void (@NotNull LibraryImpl fromModel) { Map<OrderRootType, VirtualFilePointerContainer> clonedRoots = new HashMap<>(); for (Map.Entry<OrderRootType, VirtualFilePointerContainer> entry : fromModel.myRoots.entrySet()) { OrderRootType rootType = entry.getKey(); VirtualFilePointerContainer container = entry.getValue(); VirtualFilePointerContainer clone = container.clone(myPointersDisposable, getListener()); clonedRoots.put(rootType, clone); } myRoots.clear(); myRoots.putAll(clonedRoots); VirtualFilePointerContainer excludedRoots = fromModel.myExcludedRoots; myExcludedRoots = excludedRoots != null ? excludedRoots.clone(myPointersDisposable) : null; }