void (@NotNull Statement statement) { component.push(statement); indices.put(statement, nextIndex); lowIndices.put(statement, nextIndex); nextIndex++; List<Statement> successors = statement.getNeighbours(EdgeType.REGULAR, EdgeDirection.FORWARD); // TODO: set? successors.removeAll(setProcessed); for (Statement successor : successors) { int successorIndex; if (visited.contains(successor)) { successorIndex = indices.get(successor); } else { visited.add(successor); visit(successor); successorIndex = lowIndices.get(successor); } lowIndices.put(statement, Math.min(lowIndices.get(statement), successorIndex)); } if (lowIndices.get(statement).intValue() == indices.get(statement).intValue()) { List<Statement> component = new ArrayList<>(); Statement statementInComponent; do { statementInComponent = this.component.pop(); component.add(statementInComponent); } while (statementInComponent != statement); components.add(component); } }