public static boolean isReachable(@NotNull PsiStatement statement) {
    ControlFlow flow;
    PsiElement block = statement;
    do {
      block = PsiTreeUtil.getParentOfType(block, PsiCodeBlock.class);
      if (block == null) return true;
    }
    while (block.getParent() instanceof PsiSwitchStatement);
    try {
      flow = ControlFlowFactory.getInstance(statement.getProject())
        .getControlFlow(block, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance());
    }
    catch (AnalysisCanceledException e) {
      return true;
    }
    return ControlFlowUtil.isInstructionReachable(flow, flow.getStartOffset(statement), 0);
  }
public static boolean isReachable(@NotNull PsiStatement statement)