### Question:
OtpService { public String generateUiExtensionToken(final OtpAuthenticationToken authenticationToken) { return generateToken(uiExtensionCache.asMap(), authenticationToken); } OtpService();  OtpService(final int duration, final TimeUnit units); String generateDownloadToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromDownloadToken(final String token); String generateUiExtensionToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromUiExtensionToken(final String token);  }### Answer:
@Test(expected = IllegalStateException.class) public void testMaxUiExtensionTokenLimit() throws Exception { for (int i = 1; i < OtpService.MAX_CACHE_SOFT_LIMIT + 10; i++) { try { final OtpAuthenticationToken authenticationToken = new OtpAuthenticationToken("user-identity-" + i); otpService.generateUiExtensionToken(authenticationToken); } catch (final IllegalStateException iae) { assertEquals(OtpService.MAX_CACHE_SOFT_LIMIT + 1, i); throw iae; } } }