Write attachment from event using
{@link ru.yandex.qatools.allure.utils.AllureResultsUtils#writeAttachmentSafely(byte[], String, String)}
Then add attachment to step attachments.

@param step to change
190592
@Override
    public void process(Step step) {
        Attachment attachment = writeAttachmentSafely(getAttachment(), getTitle(), getType());
        step.getAttachments().add(attachment);
    }
92905
public void setStepExecutions(java.util.Collection<StepExecution> stepExecutions) {
        if (stepExecutions == null) {
            this.stepExecutions = null;
            return;
        }

        this.stepExecutions = new com.amazonaws.internal.SdkInternalList<StepExecution>(stepExecutions);
    }
636597
public void forEachIndexed(int from, int step,
                               @NotNull IndexedIntConsumer action) {
        int index = from;
        while (iterator.hasNext()) {
            action.accept(index, iterator.nextInt());
            index += step;
        }
    }
1006763
public void setAttachmentSet(java.util.Collection<AttachmentDetails> attachmentSet) {
        if (attachmentSet == null) {
            this.attachmentSet = null;
            return;
        }

        this.attachmentSet = new com.amazonaws.internal.SdkInternalList<AttachmentDetails>(attachmentSet);
    }
128537
public void add(Matcher matcher, T attachment)
    {
        add(matcher);
        map.add(matcher, attachment);
    }
800754
public void setSteps(java.util.Collection<StepConfig> steps) {
        if (steps == null) {
            this.steps = null;
            return;
        }

        this.steps = new com.amazonaws.internal.SdkInternalList<StepConfig>(steps);
    }
919039
function(step) {
            if (!step) {
                throw new Error('Not enough arguments');
            }


            if (Array.isArray(step)) {
                step.forEach(function(s) {
                    this.add(s);
                }, this);
            } else {
                if (step.nextDelay && step.nextDelay < 0) {
                    throw new Error('nextDelay property must be greater than 0');
                }

                if (step.fn && typeof(step.fn) !== 'function') {
                    throw new Error('The property fn must be a function');
                }

                if (step.autoDestroy && typeof(step.autoDestroy) !== 'boolean') {
                    throw new Error('The property autoDestroy must be a boolean');
                }

                if (step.preload && !Array.isArray(step.preload)) {
                    throw new Error('The property preload must be an array of urls');
                }

                this.steps.push(step);
            }
            return this;
        }
788667
public void fire(StepFinishedEvent event) {
        Step step = stepStorage.adopt();
        event.process(step);

        notifier.fire(event);
    }
845033
@Override
    public void eventPostCommitAdd(Transaction transaction) throws SevereMessageStoreException
    {
        super.eventPostCommitAdd(transaction);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "eventPostCommitAdd",
                        new Object[] { transaction });

        if ((getMessageItem().getRegisterForPostEvents()) || failedInitInRestore)
        {
            stream = (MessageReferenceStream) getReferenceStream();
            //we can only register the listeners if we are fully initialized
            if ((stream instanceof DurableSubscriptionItemStream) || (stream instanceof ProxyReferenceStream))
            {
                stream.registerListeners(this);
            }
            failedInitInRestore = false;
            getMessageItem().setRegisterForPostEvents(failedInitInRestore);

        }

        if (!transaction.isAutoCommit())
        {
            try
            {
                if (POST_COMMIT_ADD_1 != null)
                {
                    POST_COMMIT_ADD_1.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction);
                }
                if (POST_COMMIT_ADD_2 != null)
                {
                    POST_COMMIT_ADD_2.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction);
                }
            } catch (SIException e)
            {
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.store.items.MessageItemReference.eventPostCommitAdd",
                                            "1:422:1.147",
                                            this);

                SibTr.exception(tc, e);

                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "eventPostCommitAdd", e);

                throw new SIErrorException(e);
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "eventPostCommitAdd");
    }
1112093
protected void setAttachmentsInternal(Map<String, ? extends Attachment> attachments) {
        if (attachments != null) {
            // this awkward looking way of doing things is to avoid marking the map as being
            // modified
            HashMap<String, Attachment> m = new HashMap<String, Attachment>();
            for (Map.Entry<String, ? extends Attachment> att : attachments.entrySet()) {
                m.put(att.getKey(), att.getValue());
            }
            this.attachments = SimpleChangeNotifyingMap.wrap(m);
        }
    }
1227347
public void addStep(DeploymentOperationStep step) {
    if(currentStep != null) {
      steps.add(steps.indexOf(currentStep)+1, step);
    } else {
      steps.add(step);
    }
  }
95977
protected function addStepElementsFor(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model, $step)
    {
        $this->displayHeader($bridge, $this->getFormTitle($step), 'h2');

        switch ($step) {
            case 2:
                $this->addStepFileCheck($bridge, $model);
                break;

            case 3:
                $this->addStepChangeTrack($bridge, $model);
                break;

            case 4:
                if ($this->trackEngine) {
                    $this->addStepRoundMatch($bridge, $model);
                } else {
                    $this->addStepCreateTrack($bridge, $model);
                }
                break;

            case 5:
                if ($this->trackEngine) {
                    $this->addStepMergeTrack($bridge, $model);
                    break;
                }
                // Intentional faal through

            default:
                $this->addStepFileImport($bridge, $model);
                break;

        }
    }
255289
@Override
    public void beforeStep(StepExecution stepExecution) {
        super.beforeStep(stepExecution);
        clearErrors();
        try {
            new Retrier().execute(new Retriable() {
                /*
                 * (non-Javadoc)
                 *
                 * @see org.duracloud.common.retry.Retriable#retry()
                 */
                @Override
                public Object retry() throws Exception {
                    RestoreStatus newStatus = RestoreStatus.VERIFYING_TRANSFERRED_CONTENT;
                    restoreManager.transitionRestoreStatus(restoreId, newStatus, "");
                    return null;
                }
            });
        } catch (Exception ex) {
            addError("failed to transition status to "
                     + RestoreStatus.VERIFYING_TRANSFERRED_CONTENT + ": " + ex.getMessage());
            stepExecution.addFailureException(ex);
        }
    }
498475
public void initialiseParamValues(final Step step) {
        final HashMap<String, String> map = new HashMap<String, String>();

        final String[] paramValues = Util.getArgs(this.parent.getPattern(),
            step.getLine(), null);

        if (paramValues != null) {
            for (int i = 0; i < paramValues.length; i++) {
                map.put(this.parent.getParamNames().get(i), paramValues[i]);
            }
        }
        this.paramValueMap = new ExampleParameter(step.getSourceLineNumber(),
            map);
    }
1353260
@Override
    protected void doAttach() throws Exception {
        if (file == null) {
            // Remove the "file:///"
            // LocalFileName localFileName = (LocalFileName) getName();
            String fileName = rootFile + getName().getPathDecoded();
            // fileName = UriParser.decode(fileName);
            file = new File(fileName); // NOSONAR
        }
    }
283526
public static void sendAttachmentText(final String text) {
		dispatchConversationTask(new ConversationDispatchTask() {
			@Override
			protected boolean execute(Conversation conversation) {
				CompoundMessage message = new CompoundMessage();
				message.setBody(text);
				message.setRead(true);
				message.setHidden(true);
				message.setSenderId(conversation.getPerson().getId());
				message.setAssociatedFiles(null);
				conversation.getMessageManager().sendMessage(message);
				return true;
			}
		}, "send attachment text");
	}
1319303
public static <Item extends IItem> void attachToView(final EventHook<Item> event, final RecyclerView.ViewHolder viewHolder, View view) {
        if (event instanceof ClickEventHook) {
            view.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                ((ClickEventHook<Item>) event).onClick(v, pos, adapter, item);
                            }
                        }
                    }
                }
            });
        } else if (event instanceof LongClickEventHook) {
            view.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                return ((LongClickEventHook<Item>) event).onLongClick(v, pos, adapter, item);
                            }
                        }
                    }
                    return false;
                }
            });
        } else if (event instanceof TouchEventHook) {
            view.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent e) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                return ((TouchEventHook<Item>) event).onTouch(v, e, pos, adapter, item);
                            }
                        }
                    }
                    return false;
                }
            });
        } else if (event instanceof CustomEventHook) {
            //we trigger the event binding
            ((CustomEventHook<Item>) event).attachEvent(view, viewHolder);
        }
    }