GameModel implements GameModelView { public void tryToAutoPlay() { aPlayingStrategy.computeNextMove(this); }  static GameModel instance(); void tryToAutoPlay();  }
@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(); } }