@Test public void testTryToAutoPlay() { try { Field strategyField = GameModel.class.getDeclaredField("aPlayingStrategy"); strategyField.setAccessible(true); StubStrategy strategy = new StubStrategy(); GameModel model = GameModel.instance(); strategyField.set(model, strategy); model.tryToAutoPlay(); assertTrue(strategy.hasExecuted()); } catch( ReflectiveOperationException e ) { fail(); } }
public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); }
GameModel implements GameModelView { public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); } }
GameModel implements GameModelView { public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); }  }
GameModel implements GameModelView { public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); }  static GameModel instance(); void tryToAutoPlay(); }
GameModel implements GameModelView { public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); }  static GameModel instance(); void tryToAutoPlay();  }