### Question:
WoodcuttingPlugin extends Plugin { @Subscribe void onChatMessage(ChatMessage event) { if (event.getType() == ChatMessageType.SPAM || event.getType() == ChatMessageType.GAMEMESSAGE) { if (WOOD_CUT_PATTERN.matcher(event.getMessage()).matches()) { if (session == null) { session = new WoodcuttingSession(); gpEarned = 0; } session.setLastChopping(); typeOfLogCut(event.getMessage()); gpEarned += itemManager.getItemPrice(treeTypeID); } if (event.getMessage().contains("A bird's nest falls out of the tree") && config.showNestNotification()) { notifier.notify("A bird nest has spawned!"); } } }    }### Answer:
@Test public void testLogs() { ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some logs.", "", 0); woodcuttingPlugin.onChatMessage(chatMessage); assertNotNull(woodcuttingPlugin.getSession()); }
@Test public void testOakLogs() { ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some oak logs.", "", 0); woodcuttingPlugin.onChatMessage(chatMessage); assertNotNull(woodcuttingPlugin.getSession()); }
@Test public void testArcticLogs() { ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get an arctic log.", "", 0); woodcuttingPlugin.onChatMessage(chatMessage); assertNotNull(woodcuttingPlugin.getSession()); }
@Test public void testMushrooms() { ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some mushrooms.", "", 0); woodcuttingPlugin.onChatMessage(chatMessage); assertNotNull(woodcuttingPlugin.getSession()); }
@Test public void testBirdsNest() { ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); when(woodcuttingConfig.showNestNotification()).thenReturn(true); woodcuttingPlugin.onChatMessage(chatMessage); verify(notifier).notify("A bird nest has spawned!"); when(woodcuttingConfig.showNestNotification()).thenReturn(false); woodcuttingPlugin.onChatMessage(chatMessage); verifyNoMoreInteractions(notifier); }