@NotNull
  private <T extends PsiElement> T createElementFromText(@NotNull String text,
                                                         @Nullable PsiElement context,
                                                         @NotNull IElementType elementType,
                                                         @NotNull Class<T> elementClass) {
    final GroovyDummyElement dummyElement = new GroovyDummyElement(elementType, text);
    final DummyHolder holder = new DummyHolder(myManager, dummyElement, context);
    final PsiElement element = holder.getFirstChild();
    final T result = ObjectUtils.tryCast(element, elementClass);
    if (result == null) {
      throw new IncorrectOperationException("Cannot create '" + elementClass.getName() + "' from text '" + text + "'");
    }
    GeneratedMarkerVisitor.markGenerated(result);
    return result;
  }
@NotNull
  private <T extends PsiElement> T createElementFromText(@NotNull String text,
                                                         @Nullable PsiElement context,
                                                         @NotNull IElementType elementType,
                                                         @NotNull Class<T> elementClass)