### Question:
AuthMeApi { public Instant getLastLoginTime(String playerName) { Long lastLogin = getLastLoginMillis(playerName); return lastLogin == null ? null : Instant.ofEpochMilli(lastLogin); } @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 shouldGetLastLoginTime() { String name = "David"; PlayerAuth auth = PlayerAuth.builder().name(name) .lastLogin(1501597979L) .build(); given(playerCache.getAuth(name)).willReturn(auth); Instant result = api.getLastLoginTime(name); assertThat(result, not(nullValue())); assertThat(result, equalTo(Instant.ofEpochMilli(1501597979L))); }
@Test public void shouldHandleNullLastLoginTime() { String name = "John"; PlayerAuth auth = PlayerAuth.builder().name(name) .lastLogin(null) .build(); given(dataSource.getAuth(name)).willReturn(auth); Instant result = api.getLastLoginTime(name); assertThat(result, nullValue()); verify(dataSource).getAuth(name); }