public static <E extends PsiElement> @NotNull E getWritable(@NotNull E element, @NotNull ModPsiUpdater updater) {
    PsiElement parent = element.getUserData(PARENT);
    if (parent != null) {
      PsiElement writableParent = updater.getWritable(parent);
      @SuppressWarnings("unchecked") E copy = (E)element.copy();
      copy.putUserData(PARENT, writableParent);
      copy.putUserData(PREFIX, element.getUserData(PREFIX));
      copy.putUserData(SUFFIX, element.getUserData(SUFFIX));
      copy.putUserData(EXPR_RANGE, element.getUserData(EXPR_RANGE));
      RangeMarker marker = element.getUserData(TEXT_RANGE);
      if (marker != null) {
        copy.putUserData(TEXT_RANGE, writableParent.getContainingFile().getFileDocument().createRangeMarker(marker.getTextRange()));
      }
      return copy;
    }
    E writable = updater.getWritable(element);
    writable.putUserData(REPLACE_NON_PHYSICAL, true);
    return writable;
  }
public static <E extends PsiElement> @NotNull E getWritable(@NotNull E element, @NotNull ModPsiUpdater updater)