byte[] data = baos.toByteArray();
in = new ObjectInputStream( new ByteArrayInputStream( data ) );
Attribute attribute2 = new DefaultAttribute( userCertificate );
attribute2.readExternal( in );
attribute2.apply( userCertificate );
assertEquals( attribute1, attribute2 );
assertEquals( "UserCertificate", attribute2.getUpId() );
}