### Question:
MarshallingResponsePopup { void onCopyToClipboard() { String clipboardMessage = view.getMessagesTableProvider().getList().stream() .map(this::buildClipboardMessage) .collect(Collectors.joining("\n")); view.copyToClipboard(clipboardMessage); } @Inject  MarshallingResponsePopup(View view, ClientTranslationService translationService); void show(String title,
                     String notificationMessage, InlineNotification.InlineNotificationType notificationType,
                     List<MarshallingMessage> messages,
                     String okCommandLabel, Command okCommand); void show(String title,
                     String notificationMessage, InlineNotification.InlineNotificationType notificationType,
                     List<MarshallingMessage> messages,
                     String okCommandLabel);  }### Answer:
@Test public void testOnCopyToClipboard() { List<MarshallingMessage> messages = mockMessages(); popup.show(TITLE, NOTIFICATION_MESSAGE, NOTIFICATION_TYPE, messages, OK_COMMAND_LABEL, okCommand); StringBuilder expectedMessage = new StringBuilder(); rows.forEach(row -> { if (expectedMessage.length() > 0) { expectedMessage.append("\n"); } expectedMessage.append(row.getLevel()); expectedMessage.append(", "); expectedMessage.append(row.getMessage()); }); popup.onCopyToClipboard(); verify(view).copyToClipboard(stringCaptor.capture()); assertEquals(expectedMessage.toString(), stringCaptor.getValue()); }