private static @Nullable @NonNls String getReplacement(PsiStatement statement) {
    PsiElement parent = statement.getParent();
    if (parent instanceof PsiIfStatement || parent instanceof PsiLabeledStatement) {
      return getReplacement((PsiStatement)parent);
    }
    PsiStatement nextStatement = PsiTreeUtil.getNextSiblingOfType(statement, PsiStatement.class);
    if (nextStatement != null) {
      if (nextStatement instanceof PsiContinueStatement ||
          nextStatement instanceof PsiBreakStatement ||
          nextStatement instanceof PsiReturnStatement ||
          nextStatement instanceof PsiThrowStatement) {
        return nextStatement.getText();
      }
      return null;
    }
    if (parent == null) return null;
    if (parent instanceof PsiLoopStatement) {
      return "continue;";
    }
    if (parent instanceof PsiCodeBlock) {
      PsiElement grandParent = parent.getParent();
      if (grandParent instanceof PsiMethod && PsiTypes.voidType().equals(((PsiMethod)grandParent).getReturnType()) ||
          grandParent instanceof PsiLambdaExpression &&
          PsiTypes.voidType().equals(LambdaUtil.getFunctionalInterfaceReturnType((PsiFunctionalExpression)grandParent))) {
        return "return;";
      }
      if (grandParent instanceof PsiBlockStatement) {
        return getReplacement((PsiStatement)grandParent);
      }
    }
    return null;
  }
private static @Nullable @NonNls String getReplacement(PsiStatement statement)