int n = sockets.size();
for (int i = 0; i < n; ++i)
{
NodeSocket socket = (NodeSocket) sockets.get(i);
socket = (NodeSocket) socket.clone();
NamedObjectCollectionUtil.createUniqueName(socket, targetNode.getSocketList());
targetNode.addSocket(socket);
socket.maintainReferences(ModelObject.RESOLVE_GLOBAL_REFS | ModelObject.RESOLVE_LOCAL_REFS);