// add all versions to map of versions to restore
Map<NodeId, InternalVersion> toRestore =
new HashMap<NodeId, InternalVersion>();
for (Version version : versions) {
InternalVersion v =
vMgr.getVersion(((VersionImpl) version).getNodeId());
// check for collision
NodeId historyId = v.getVersionHistory().getId();
if (toRestore.containsKey(historyId)) {
throw new VersionException(
"Unable to restore. Two or more versions have same version history.");
}
toRestore.put(historyId, v);