AudioWidget extends QuestionWidget implements FileWidget, BinaryDataReceiver { @Override public void setOnLongClickListener(OnLongClickListener l) { binding.captureButton.setOnLongClickListener(l); binding.chooseButton.setOnLongClickListener(l); } AudioWidget(Context context, QuestionDetails prompt, QuestionMediaManager questionMediaManager, WaitingForDataRegistry waitingForDataRegistry);   AudioWidget(Context context, QuestionDetails questionDetails, @NonNull FileUtil fileUtil, @NonNull MediaUtil mediaUtil, @NonNull AudioControllerView audioController,
                QuestionMediaManager questionMediaManager, WaitingForDataRegistry waitingForDataRegistry, AudioHelper audioHelper, ActivityAvailability activityAvailability); @Override void deleteFile(); @Override void clearAnswer(); @Override IAnswerData getAnswer(); @Override void setBinaryData(Object object); @Override void setOnLongClickListener(OnLongClickListener l); @Override void cancelLongPress();  }
@Test public void clickingButtonsForLong_callsOnLongClickListeners() { View.OnLongClickListener listener = mock(View.OnLongClickListener.class); AudioWidget widget = createWidget(promptWithAnswer(null)); widget.setOnLongClickListener(listener); widget.binding.captureButton.performLongClick(); widget.binding.chooseButton.performLongClick(); verify(listener).onLongClick(widget.binding.captureButton); verify(listener).onLongClick(widget.binding.chooseButton); }