### Question:
CookingPlugin extends Plugin { @Subscribe void onSpotAnimationChanged(SpotAnimationChanged graphicChanged) { Player player = client.getLocalPlayer(); if (graphicChanged.getActor() != player) { return; } if (player.getSpotAnimation() == GraphicID.WINE_MAKE && config.fermentTimer()) { Optional<FermentTimer> fermentTimerOpt = infoBoxManager.getInfoBoxes().stream() .filter(FermentTimer.class::isInstance) .map(FermentTimer.class::cast) .findAny(); if (fermentTimerOpt.isPresent()) { FermentTimer fermentTimer = fermentTimerOpt.get(); fermentTimer.reset(); } else { FermentTimer fermentTimer = new FermentTimer(itemManager.getImage(ItemID.JUG_OF_WINE), this); infoBoxManager.addInfoBox(fermentTimer); } } }    }### Answer:
@Test public void testOnSpotAnimationChanged() { Player player = mock(Player.class); when(player.getSpotAnimation()).thenReturn(GraphicID.WINE_MAKE); when(config.fermentTimer()).thenReturn(true); when(client.getLocalPlayer()).thenReturn(player); SpotAnimationChanged graphicChanged = new SpotAnimationChanged(); graphicChanged.setActor(player); cookingPlugin.onSpotAnimationChanged(graphicChanged); verify(infoBoxManager).addInfoBox(any(FermentTimer.class)); }