public class OAuth2ConnectionTest {
@Test
public void oauth2ConnectionSerializable() throws Exception {
OAuth2Connection<FakeApi> connection = new OAuth2Connection<FakeApi>(
new ConnectionData("a", "b", "c", "d", "e", "f", "g", "h", 123L),
new FakeServiceProvider("i", "j"), new FakeApiAdapter());
byte[] byteArray = SerializationUtils.serialize(connection);
@SuppressWarnings("unchecked")
OAuth2Connection<FakeApi> connectionFromArray = (OAuth2Connection<FakeApi>) SerializationUtils.deserialize(byteArray);