### Question:
SpringSecurityContext { @Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; } private  SpringSecurityContext(); @Nullable static Token getToken(); @Nullable static AccessToken getAccessToken(); static void clear();  }### Answer:
@Test public void getAccessToken() { setToken(token, NO_SCOPES); assertThat(SpringSecurityContext.getAccessToken()).isEqualTo(token); }
@Test public void getAccessTokenScopes() { Set<String> scopes = new HashSet<>(); scopes.add("Scope1"); scopes.add("Scope2"); setToken(token, scopes); assertThat(SpringSecurityContext.getAccessToken().getScopes()).isEmpty(); assertThat(SpringSecurityContext.getAccessToken().hasLocalScope("Scope1")).isTrue(); assertThat(SpringSecurityContext.getAccessToken().hasLocalScope("Scope3")).isFalse(); }
@Test @Ignore public void getAccessTokenReturnsNullIfTokenDoesNotImplementInterface() { setToken(sapIdToken, NO_SCOPES); assertThat(SpringSecurityContext.getAccessToken()).isNull(); }