Branched (@NotNull PsiLocalVariable var) { List<PsiExpressionStatement> initializers = initializers(var); if (initializers.isEmpty()) return null; if (!(var.getParent() instanceof PsiDeclarationStatement decl)) return null; if (!(decl.getParent() instanceof PsiCodeBlock block)) return null; PsiElement commonParent = PsiTreeUtil.findCommonParent(initializers); PsiIfStatement ifStatement = getTopLevelIfStatement(block, commonParent); if (ifStatement == null) return null; InitMode mode = StreamEx.of(initializers) .map(initStatement -> InitMode.create(initStatement, ifStatement)) .collect(MoreCollectors.reducingWithZero(ExactMode.BOTTOM, ExactMode.NOT_INITIALIZED, InitMode::join)); if (!(mode instanceof Branched branched)) return null; return branched; }