@Test public void testClubbedTroll() { final SimpleTroll simpleTroll = spy(new SimpleTroll()); final ClubbedTroll 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); }
public ClubbedTroll(Troll decorated) { this.decorated = decorated; }
ClubbedTroll implements Troll { public ClubbedTroll(Troll decorated) { this.decorated = decorated; } }
ClubbedTroll implements Troll { public ClubbedTroll(Troll decorated) { this.decorated = decorated; } ClubbedTroll(Troll decorated); }
ClubbedTroll implements Troll { public ClubbedTroll(Troll decorated) { this.decorated = decorated; } ClubbedTroll(Troll decorated); @Override void attack(); @Override int getAttackPower(); @Override void fleeBattle(); }
ClubbedTroll implements Troll { public ClubbedTroll(Troll decorated) { this.decorated = decorated; } ClubbedTroll(Troll decorated); @Override void attack(); @Override int getAttackPower(); @Override void fleeBattle();  }