SessionUser implements Serializable { public boolean isLoggedIn() { OAuth2Authenticator oAuth2 = bitbucketClient.getOAuth2Authenticator(); return oAuth2.getAccessToken() != null; } SessionUser();  SessionUser(final BitbucketClient bitbucketClient); BitbucketClient getBitbucketClient(); String getBitbucketClientId(); @Resource(name = "bitbucketClientId", type = String.class, description = "OAuth 2 client identifier for the Bitbucket API.") void setBitbucketClientId(final String value); @Resource(name = "bitbucketClientSecret", type = String.class, description = "OAuth 2 client secret for the Bitbucket API.") void setBitbucketClientSecret(final String value); boolean isLoggedIn(); String login(); String logout(); void login(final String code, final String state); void abortLogin(final String errorDescription, final String state); @Override int hashCode(); @Override boolean equals(final Object object);  }
@Test void testDefault() { SessionUser sessionUser = new SessionUser(new BitbucketClient()); assertFalse(sessionUser.isLoggedIn()); }