private static Statement findFirstBlock(Statement stat, Set<Statement> setStats) {
    LinkedList<Statement> stack = new LinkedList<>();
    stack.add(stat);

    while (!stack.isEmpty()) {
      Statement st = stack.remove(0);

      if (stack.isEmpty() || setStats.contains(st)) {
        if (st.isLabeled() && !stack.isEmpty() || st.getExprents() != null) {
          return st;
        }

        stack.clear();

        switch (st.type) {
          case SEQUENCE -> stack.addAll(0, st.getStats());
          case IF, ROOT, SWITCH, SYNCHRONIZED -> stack.add(st.getFirst());
          default -> {
            return st;
          }
        }
      }
    }

    return null;
  }
private static Statement findFirstBlock(Statement stat, Set<Statement> setStats)