InitMode (@NotNull InitMode nextMode) { if (nextMode == ExactMode.NOT_INITIALIZED) return this; if (!(nextMode instanceof Branched branched)) return ExactMode.BOTTOM; if (ifStatement() != branched.ifStatement()) return ExactMode.BOTTOM; InitMode newThen = thenBranch().join(branched.thenBranch()); InitMode newElse = elseBranch().join(branched.elseBranch()); if (newThen == ExactMode.BOTTOM || newElse == ExactMode.BOTTOM) return ExactMode.BOTTOM; if (newThen == newElse) return newThen; return new Branched(ifStatement(), newThen, newElse); }