void (@NotNull ArrangementEntryDependencyInfo info) { Deque<ArrangementEntryDependencyInfo> toProcess = new ArrayDeque<>(); toProcess.add(info); JavaElementArrangementEntry prev = info.getAnchorEntry(); while (!toProcess.isEmpty()) { ArrangementEntryDependencyInfo current = toProcess.removeFirst(); for (ArrangementEntryDependencyInfo dependencyInfo : current.getDependentEntriesInfos()) { JavaElementArrangementEntry dependencyMethod = dependencyInfo.getAnchorEntry(); if (dependencyMethod.getDependencies() == null) { dependencyMethod.addDependency(prev); prev = dependencyMethod; } toProcess.addLast(dependencyInfo); } } }