private static PsiStatement @NotNull [] addStatements(@NotNull PsiElementFactory factory,
                                                        @NotNull PsiStatement chainStatement,
                                                        @NotNull String code) {
    PsiStatement[] statements = ControlFlowUtils.unwrapBlock(factory.createStatementFromText("{\n" + code + "\n}", chainStatement));
    PsiElement parent = chainStatement.getParent();
    return ContainerUtil.map(statements, s -> (PsiStatement)parent.addBefore(s, chainStatement), PsiStatement.EMPTY_ARRAY);
  }
private static PsiStatement @NotNull [] addStatements(@NotNull PsiElementFactory factory,
                                                        @NotNull PsiStatement chainStatement,
                                                        @NotNull String code)