code: public boolean isValid(String nonce) {
  
          // Remove nonce, verifying whether it was present at all
          Long expires = nonces.remove(nonce);
          if (expires == null)
              return false;
  
          // Nonce is only valid if it hasn't expired
          return expires > System.currentTimeMillis();
  
      }
docs: Returns whether the give nonce value is valid. A nonce is valid if and
  only if it was generated by this instance of the NonceService. Testing
  nonce validity through this function immediately and permanently
  invalidates that nonce.
  
  @param nonce
  The nonce value to test.
  
  @return
  true if the provided nonce is valid, false otherwise.