### Question:
Single implements Game { @Override public Joystick getJoystick() { Joystick joystick = player.getJoystick(); if (joystick != null) { return joystick; } return player.getHero(); } Single(GamePlayer player, PrinterFactory factory);  Single(GamePlayer player, PrinterFactory factory, MultiplayerType multiplayerType); void on(GameField field); @Override void setProgress(LevelProgress progress); @Override LevelProgress getProgress(); @Override Joystick getJoystick(); @Override boolean isGameOver(); @Override boolean isWin(); @Override boolean shouldLeave(); @Override void newGame(); @Override void loadSave(JSONObject save); @Override Object getBoardAsString(); @Override void close(); @Override void clearScore(); @Override HeroData getHero(); @Override JSONObject getSave(); @Override GamePlayer getPlayer(); @Override GameField getField();  }### Answer:
@Test public void callJoystickFromPlayer_ifRealizedInPlayer() { when(player.getJoystick()).thenReturn(joystick); Joystick joystick = game.getJoystick(); assertSame(this.joystick, joystick); }
@Test public void callJoystickFromHero_ifNotRealizedInPlayer() { when(player.getJoystick()).thenReturn(null); Joystick joystick = game.getJoystick(); assertSame(this.hero, joystick); }