final LinkedList<String> roles = new LinkedList<String>();
roles.add( RepositoryCreateAction.NAME );
bindingMap.put( "admin", roles );
final HashSet<String> immutableRoles = new HashSet<String>();
immutableRoles.add( "admin" );
final RoleBindingStruct roleBindingStruct = new RoleBindingStruct( logicalRoleNameMap, bindingMap, immutableRoles );
RoleBindingStructAdapter adapter = new RoleBindingStructAdapter();
final JaxbSafeRoleBindingStruct marshaled = adapter.marshal( roleBindingStruct );
assertEquals( roleBindingStruct.bindingMap.size(), marshaled.bindingMapEntries.size() );
assertEquals( roleBindingStruct.logicalRoleNameMap.size(), marshaled.logicalRoleNameMapEntries.size() );
assertEquals( roleBindingStruct.immutableRoles.size(), marshaled.immutableRoles.size() );
final RoleBindingStruct unmarshaled = adapter.unmarshal( marshaled );
assertEquals( roleBindingStruct.bindingMap, unmarshaled.bindingMap );
assertEquals( roleBindingStruct.logicalRoleNameMap, unmarshaled.logicalRoleNameMap );
assertEquals( roleBindingStruct.immutableRoles, unmarshaled.immutableRoles );
}