### Question:
ClubbedTroll implements Troll { public ClubbedTroll(Troll decorated) { this.decorated = decorated; } ClubbedTroll(Troll decorated); @Override void attack(); @Override int getAttackPower(); @Override void fleeBattle();  }### Answer:
@Test public void testClubbedTroll() { final Troll simpleTroll = spy(new SimpleTroll()); final Troll clubbed = new ClubbedTroll(simpleTroll); assertEquals(20, clubbed.getAttackPower()); verify(simpleTroll, times(1)).getAttackPower(); clubbed.attack(); verify(simpleTroll, times(1)).attack(); clubbed.fleeBattle(); verify(simpleTroll, times(1)).fleeBattle(); verifyNoMoreInteractions(simpleTroll); }
@Test public void testClubbedTroll() { final var simpleTroll = spy(new SimpleTroll()); final var clubbed = new ClubbedTroll(simpleTroll); assertEquals(20, clubbed.getAttackPower()); verify(simpleTroll, times(1)).getAttackPower(); clubbed.attack(); verify(simpleTroll, times(1)).attack(); clubbed.fleeBattle(); verify(simpleTroll, times(1)).fleeBattle(); verifyNoMoreInteractions(simpleTroll); }
@Test public void testClubbedTroll() throws Exception { final Troll simpleTroll = spy(new SimpleTroll()); final Troll clubbed = new ClubbedTroll(simpleTroll); assertEquals(20, clubbed.getAttackPower()); verify(simpleTroll, times(1)).getAttackPower(); clubbed.attack(); verify(simpleTroll, times(1)).attack(); clubbed.fleeBattle(); verify(simpleTroll, times(1)).fleeBattle(); verifyNoMoreInteractions(simpleTroll); }