### Question:
RecoveryCodeService implements SettingsDependent, HasCleanup { public String generateCode(String player) { String code = RandomStringUtils.generateHex(recoveryCodeLength); playerTries.put(player, recoveryCodeMaxTries); recoveryCodes.put(player, code); return code; } @Inject  RecoveryCodeService(Settings settings); boolean isRecoveryCodeNeeded(); String generateCode(String player); boolean isCodeValid(String player, String code); boolean hasTriesLeft(String player); int getTriesLeft(String player); void removeCode(String player); @Override void reload(Settings settings); @Override void performCleanup();  }### Answer:
@Test public void shouldGenerateAndStoreCode() { String name = "Bobbers"; recoveryCodeService.generateCode(name); String code = getCodeMap().get(name); assertThat(code, stringWithLength(5)); }