### Question:
ChatNotificationsPlugin extends Plugin { @Subscribe public void onSetMessage(SetMessage event) { MessageNode messageNode = event.getMessageNode(); String nodeValue = Text.removeTags(messageNode.getValue()); boolean update = false; switch (event.getType()) { case TRADE: if (event.getValue().contains("wishes to trade with you.") && config.notifyOnTrade()) { notifier.notify(event.getValue()); } break; case DUEL: if (event.getValue().contains("wishes to duel with you.") && config.notifyOnDuel()) { notifier.notify(event.getValue()); } break; case GAME: if (event.getName().equals(runeLiteProperties.getTitle())) { return; } break; } if (usernameMatcher == null && client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null) { String username = client.getLocalPlayer().getName(); usernameMatcher = Pattern.compile("\\b(" + quote(username) + ")\\b", Pattern.CASE_INSENSITIVE); usernameReplacer = "<col" + ChatColorType.HIGHLIGHT.name() + "><u>" + username + "</u><col" + ChatColorType.NORMAL.name() + ">"; } if (config.highlightOwnName() && usernameMatcher != null) { Matcher matcher = usernameMatcher.matcher(messageNode.getValue()); if (matcher.find()) { messageNode.setValue(matcher.replaceAll(usernameReplacer)); update = true; if (config.notifyOnOwnName()) { sendNotification(event); } } } if (highlightMatcher != null) { Matcher matcher = highlightMatcher.matcher(nodeValue); boolean found = false; StringBuffer stringBuffer = new StringBuffer(); while (matcher.find()) { String value = matcher.group(); matcher.appendReplacement(stringBuffer, "<col" + ChatColorType.HIGHLIGHT + ">" + value + "<col" + ChatColorType.NORMAL + ">"); update = true; found = true; } if (found) { matcher.appendTail(stringBuffer); messageNode.setValue(stringBuffer.toString()); if (config.notifyOnHighlight()) { sendNotification(event); } } } if (update) { messageNode.setRuneLiteFormatMessage(messageNode.getValue()); chatMessageManager.update(messageNode); } }  @Override void startUp(); @Subscribe void onGameStateChanged(GameStateChanged event); @Subscribe void onConfigChanged(ConfigChanged event); @Subscribe void onSetMessage(SetMessage event);  }### Answer:
@Test public void onSetMessage() { when(config.highlightWordsString()).thenReturn("Deathbeam, Deathbeam OSRS , test"); MessageNode messageNode = mock(MessageNode.class); when(messageNode.getValue()).thenReturn("Deathbeam, Deathbeam OSRS"); SetMessage setMessage = new SetMessage(); setMessage.setType(ChatMessageType.PUBLIC); setMessage.setMessageNode(messageNode); chatNotificationsPlugin.startUp(); chatNotificationsPlugin.onSetMessage(setMessage); verify(messageNode).setValue("<colHIGHLIGHT>Deathbeam<colNORMAL>, <colHIGHLIGHT>Deathbeam<colNORMAL> OSRS"); }