CompositeTokenProvider implements TokenProvider { @Nullable @Override public TokenInfo getTokenInfo(@NotNull String token) { for (TokenProvider tp : providers) { TokenInfo info = tp.getTokenInfo(token); if (info != null) { return info; } } return null; } private  CompositeTokenProvider(@NotNull List<? extends TokenProvider> providers); @NotNull static TokenProvider newInstance(@NotNull TokenProvider... providers); @NotNull static TokenProvider newInstance(@NotNull List<? extends TokenProvider> providers); @Override boolean doCreateToken(@NotNull Credentials credentials); @Nullable @Override TokenInfo createToken(@NotNull Credentials credentials); @Nullable @Override TokenInfo createToken(@NotNull String userId, @NotNull Map<String, ?> attributes); @Nullable @Override TokenInfo getTokenInfo(@NotNull String token);  }
@Test public void testGetTokenInfo() { assertSame(info, composite.getTokenInfo(TOKEN)); assertNull(composite.getTokenInfo("any")); }