### Question:
NonceVerifierImpl implements NonceVerifier { public void verifyNonce(String tokenKey, String clientNonceString, String clientTimestampString) throws OAuthServiceException { if (StringUtils.isEmpty(clientNonceString) || StringUtils.isEmpty(clientTimestampString)) { throw new OAuthServiceException("Nonce or timestamp is not available"); } long serverClock = System.currentTimeMillis(); long clientTimestamp = Long.parseLong(clientTimestampString); NonceHistory nonceHistory = nonceStore.getNonceHistory(tokenKey); Nonce nonce = new Nonce(clientNonceString, clientTimestamp); if (nonceHistory == null) { long requestTimeDelta = serverClock - clientTimestamp; nonceStore.initNonceHistory(tokenKey, nonce, requestTimeDelta); } else { checkAdjustedRequestTime(serverClock, clientTimestamp, nonceHistory); if (!nonceHistory.addNonce(nonce)) { throw new OAuthServiceException("Duplicate nonce"); } } }  void verifyNonce(String tokenKey, String clientNonceString, String clientTimestampString); void setAllowedWindow(long allowedWindow); void setNonceStore(NonceStore nonceStore);  }### Answer:
@Test public void testVerifyNonce() { long now = System.currentTimeMillis(); Nonce nonce1 = new Nonce("nonce1", now - 2000); Nonce nonce2 = new Nonce("nonce2", now - 1000); NonceHistory nonceHistory = new NonceHistory(200, nonce1); nonceHistory.addNonce(nonce2); EasyMock.expect(nonceStore.getNonceHistory("testTokenKey")).andReturn(nonceHistory); EasyMock.replay(nonceStore); nonceVerifier.setAllowedWindow(2000); nonceVerifier.verifyNonce("testTokenKey", "nonce3", Long.toString(now - 500)); EasyMock.verify(nonceStore); }