@Subscribe
	public void onVarbitChanged(VarbitChanged varbitChanged)
	{
		if (varbitChanged.getVarpId() == VarPlayer.CANNON_AMMO)
		{
			int old = cballsLeft;
			cballsLeft = varbitChanged.getValue();

			if (cballsLeft > old)
			{
				cannonBallNotificationSent = false;
			}

			if (!cannonBallNotificationSent && cballsLeft > 0 && config.lowWarningThreshold() >= cballsLeft)
			{
				notifier.notify(config.showCannonNotifications(), String.format("Your cannon has %d cannon balls remaining!", cballsLeft));
				cannonBallNotificationSent = true;
			}
		}
		else if (varbitChanged.getVarpId() == VarPlayer.CANNON_COORD)
		{
			WorldPoint c = WorldPoint.fromCoord(varbitChanged.getValue());
			cannonPosition = buildCannonWorldArea(c);
		}
		else if (varbitChanged.getVarpId() == VarPlayer.CANNON_STATE)
		{
			cannonPlaced = varbitChanged.getValue() == 4;

			if (cannonPlaced)
			{
				addCounter();
			}
			else
			{
				removeCounter();
			}
		}
	}
@Test
	public void testThresholdNotificationShouldNotify()
	{
		when(config.showCannonNotifications()).thenReturn(Notification.ON);
		when(config.lowWarningThreshold()).thenReturn(10);

		cannonAmmoChanged.setValue(30);
		plugin.onVarbitChanged(cannonAmmoChanged);
		cannonAmmoChanged.setValue(10);
		plugin.onVarbitChanged(cannonAmmoChanged);

		verify(notifier, times(1)).notify(Notification.ON, "Your cannon has 10 cannon balls remaining!");
	}