Very simple - but highly effective - TokenResponseCache implementation. Please carefully monitor the performance / cache hit-ratio in production as the maxSize in combination with the expireTimeSeconds is important. If the maxSize is too small and the expireTimeSeconds to low it will result in a cache that with each addition will try to make space (e.g. effectively only removing the oldest entry each time).
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.