### Question:
ConcurrentClusterFlowChecker { public static TokenResult acquireConcurrentToken( String clientAddress, FlowRule rule, int acquireCount) { long flowId = rule.getClusterConfig().getFlowId(); AtomicInteger nowCalls = CurrentConcurrencyManager.get(flowId); if (nowCalls == null) { RecordLog.warn("[ConcurrentClusterFlowChecker] Fail to get nowCalls by flowId<{}>", flowId); return new TokenResult(TokenResultStatus.FAIL); } if (nowCalls.get() + acquireCount > calcGlobalThreshold(rule)) { ClusterServerStatLogUtil.log("concurrent|block|" + flowId, acquireCount); return new TokenResult(TokenResultStatus.BLOCKED); } synchronized (nowCalls) { if (nowCalls.get() + acquireCount > calcGlobalThreshold(rule)) { ClusterServerStatLogUtil.log("concurrent|block|" + flowId, acquireCount); return new TokenResult(TokenResultStatus.BLOCKED); } else { nowCalls.getAndAdd(acquireCount); } } ClusterServerStatLogUtil.log("concurrent|pass|" + flowId, acquireCount); TokenCacheNode node = TokenCacheNode.generateTokenCacheNode(rule, acquireCount, clientAddress); TokenCacheNodeManager.putTokenCacheNode(node.getTokenId(), node); TokenResult tokenResult = new TokenResult(TokenResultStatus.OK); tokenResult.setTokenId(node.getTokenId()); return tokenResult; }  static double calcGlobalThreshold(FlowRule rule); static TokenResult acquireConcurrentToken(/*@Valid*/ String clientAddress, FlowRule rule, int acquireCount); static TokenResult releaseConcurrentToken(/*@Valid*/ long tokenId);  }### Answer:
@Test public void testReleaseExpiredToken() throws InterruptedException { ConnectionManager.addConnection("test", "127.0.0.1"); FlowRule rule = ClusterFlowRuleManager.getFlowRuleById(111L); for (int i = 0; i < 10; i++) { ConcurrentClusterFlowChecker.acquireConcurrentToken("127.0.0.1", rule, 1); } Thread.sleep(3000); Assert.assertTrue("fail to acquire and release token", CurrentConcurrencyManager.get(rule.getClusterConfig().getFlowId()).get() == 0 && TokenCacheNodeManager.getSize() == 0); }