@Test public void testUseWithCleanup() { final Inventory inventory = mock(Inventory.class); final Character character = mock(Character.class); when(character.getInventory()).thenReturn(inventory); when(character.getHitPoints()).thenReturn(USER_HP); potion2.use(character); verify(inventory).cleanup(); verify(character).addToHitPoints(-USER_HP); }
@Override public void use(Character character) { super.use(character); character.addToHitPoints(-character.getHitPoints()); }
DeathPotion extends ConsumableItem { @Override public void use(Character character) { super.use(character); character.addToHitPoints(-character.getHitPoints()); } }
DeathPotion extends ConsumableItem { @Override public void use(Character character) { super.use(character); character.addToHitPoints(-character.getHitPoints()); } DeathPotion(ItemProperties properties, int amount); }
DeathPotion extends ConsumableItem { @Override public void use(Character character) { super.use(character); character.addToHitPoints(-character.getHitPoints()); } DeathPotion(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
DeathPotion extends ConsumableItem { @Override public void use(Character character) { super.use(character); character.addToHitPoints(-character.getHitPoints()); } DeathPotion(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }