public void test() throws Exception {
@SuppressWarnings("unchecked")
final OAuth2ConnectionFactory<Object> factory = mock(OAuth2ConnectionFactory.class);
final OAuth2Operations operations = mock(OAuth2Operations.class);
final String serverName = "example.com";
final AccessGrant accessGrant = new AccessGrant("my_token");
final String code = "code";
final Connection<Object> connection = DummyConnection.dummy("provider", "user");
final OAuth2AuthenticationService<Object> authSvc = new OAuth2AuthenticationService<Object>(factory);
authSvc.getReturnToUrlParameters().add("param");