### Question:
AuthMeApi { public void forceUnregister(Player player) { management.performUnregisterByAdmin(null, player.getName(), player); } @Inject  AuthMeApi(AuthMe plugin, DataSource dataSource, PlayerCache playerCache, PasswordSecurity passwordSecurity,
              Management management, ValidationService validationService, GeoIpService geoIpService); static AuthMeApi getInstance(); AuthMe getPlugin(); String getPluginVersion(); boolean isAuthenticated(Player player); boolean isNpc(Player player); boolean isUnrestricted(Player player); Location getLastLocation(Player player); String getLastIp(String playerName); List<String> getNamesByIp(String address); @Deprecated Date getLastLogin(String playerName); Instant getLastLoginTime(String playerName); boolean isRegistered(String playerName); boolean checkPassword(String playerName, String passwordToCheck); boolean registerPlayer(String playerName, String password); void forceLogin(Player player); void forceLogout(Player player); void forceRegister(Player player, String password, boolean autoLogin); void forceRegister(Player player, String password); void forceUnregister(Player player); void forceUnregister(String name); void changePassword(String name, String newPassword); List<String> getRegisteredNames(); List<String> getRegisteredRealNames(); String getCountryCode(String ip); String getCountryName(String ip);  }### Answer:
@Test public void shouldUnregisterPlayer() { Player player = mock(Player.class); String name = "Donald"; given(player.getName()).willReturn(name); api.forceUnregister(player); verify(management).performUnregisterByAdmin(null, name, player); }
@Test public void shouldUnregisterPlayerByName() { Server server = mock(Server.class); ReflectionTestUtils.setField(Bukkit.class, null, "server", server); String name = "tristan"; Player player = mock(Player.class); given(server.getPlayer(name)).willReturn(player); api.forceUnregister(name); verify(management).performUnregisterByAdmin(null, name, player); }