Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Index.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Index.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Index.cs	(revision 15986)
@@ -59,4 +59,8 @@
     }
 
+    public bool TryGetValue(uint index, out T value) {
+      return values.TryGetValue(index, out value);
+    }
+
     public IEnumerable<T> GetValues() {
       return values.Values;
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Mapper.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Mapper.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/Mapper.cs	(revision 15986)
@@ -93,4 +93,8 @@
     public Type GetType(uint typeId) {
       return types.GetValue(typeId);
+    }
+
+    public bool TryGetType(uint typeId, out Type type) {
+      return types.TryGetValue(typeId, out type);
     }
     #endregion
@@ -132,5 +136,5 @@
         o = transformer.ToObject(box, this);
         boxId2Object.Add(boxId, o);
-        transformer.FillFromBox(o, box, this);
+        if (o != null) transformer.FillFromBox(o, box, this);
       }
 
@@ -176,5 +180,32 @@
       mapper.strings = new Index<string>(bundle.Strings);
 
-      return mapper.GetObject(bundle.RootBoxId);
+      var root = mapper.GetObject(bundle.RootBoxId);
+
+      ExecuteAfterDeserializationHooks(mapper.boxId2Object.Values.ToArray());
+
+      return root;
+    }
+
+    private static void ExecuteAfterDeserializationHooks(object[] objects) {
+      var emptyArgs = new object[0];
+
+      foreach (var obj in objects) {
+        if (!StorableTypeAttribute.IsStorableType(obj.GetType())) continue; // TODO: performance
+
+        var typeStack = new Stack<Type>();
+        for (var type = obj.GetType(); type != null; type = type.BaseType) {
+          typeStack.Push(type);
+        }
+
+        while (typeStack.Any()) {
+          var type = typeStack.Pop();
+          if (!StorableTypeAttribute.IsStorableType(type)) continue; // object <- mytype (has hooks) or object <- valuetype <- mystruct
+
+          var typeInfo = staticCache.GetTypeInfo(type);
+          foreach (var hook in typeInfo.AfterDeserializationHooks) {
+            hook.Invoke(obj, emptyArgs);
+          }
+        }
+      }
     }
   }
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StaticCache.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 15986)
@@ -68,4 +68,6 @@
       RegisterType(new Guid("724A2D49-7E7B-455B-BBA9-4214C64E8A21"), typeof(TimeSpan));
       RegisterType(new Guid("ECC12A57-DA8D-43D9-9EC7-FCAC878A4D69"), typeof(Font));
+      RegisterType(new Guid("494C1352-A1C3-47A3-8754-A0B19B8F1567"), typeof(FontStyle));
+      RegisterType(new Guid("41147B67-4C7A-4907-9F6C-509568395EDB"), typeof(GraphicsUnit));
       RegisterType(new Guid("E8348C94-9817-4164-9C98-377689F83F30"), typeof(Bitmap));
       RegisterType(new Guid("05551382-E894-4218-B860-FEE1D92CA07D"), typeof(Nullable<>));
@@ -111,9 +113,4 @@
             if (StorableTypeAttribute.IsStorableType(t)) {
               RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(t).Guid, t);
-            }
-            foreach (var mi in t.GetMethods(BindingFlags.NonPublic | BindingFlags.Static)) {
-              if (StorableConversionAttribute.IsStorableConversionMethod(mi)) {
-                RegisterStorableConversion(StorableConversionAttribute.GetStorableConversionAttribute(mi).Guid, mi);
-              }
             }
           }
@@ -194,22 +191,4 @@
       }
     }
-
-    public IEnumerable<MethodInfo> GetStorableConversions(Guid guid) {
-      List<MethodInfo> conversionMethods;
-      if (guid2ConversionMethods.TryGetValue(guid, out conversionMethods)) return conversionMethods;
-      return Enumerable.Empty<MethodInfo>();
-    }
-
-    public IEnumerable<MethodInfo> GetStorableConversions(IList<Tuple<Guid, uint>> typeChain) {
-      foreach (var type in typeChain) {
-        var conversionMethod = (from methodInfo in GetStorableConversions(type.Item1)
-                                let attrib = StorableConversionAttribute.GetStorableConversionAttribute(methodInfo)
-                                where attrib.Version == type.Item2 && (attrib.Dependencies == null || 
-                                  attrib.Dependencies.All(x => typeChain.Any(y => y.Item1 == Guid.Parse(x.Key) && y.Item2 == x.Value)))
-                                select methodInfo).SingleOrDefault();
-        if (conversionMethod != null)
-          yield return conversionMethod;
-      }
-    }
   }
 }
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableConversionAttribute.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableConversionAttribute.cs	(revision 15878)
+++ 	(revision )
@@ -1,61 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace HeuristicLab.Persistence {
-  [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
-  public sealed class StorableConversionAttribute : Attribute {
-    public Guid Guid { get; private set; }
-    public uint Version { get; private set; }
-    public IDictionary<string, uint> Dependencies { get; private set; }
-
-    public StorableConversionAttribute(string guid, uint version = 1u)
-      : this(guid, version, null) { }
-    public StorableConversionAttribute(string guid, uint version = 1u, string baseGuid = "", uint baseVersion = 0u)
-      : this(guid, version, string.IsNullOrEmpty(baseGuid) ? null : new Dictionary<string, uint> { { baseGuid, baseVersion } }) { }
-
-    public StorableConversionAttribute(string guid, uint version = 1u, IDictionary<string, uint> dependencies = null) {
-      this.Guid = new Guid(guid);
-      this.Version = version;
-      this.Dependencies = dependencies;
-    }
-
-    public static bool IsStorableConversionMethod(MethodInfo mi) {
-      return Attribute.IsDefined(mi, typeof(StorableConversionAttribute), false);
-    }
-
-    public static StorableConversionAttribute GetStorableConversionAttribute(MethodInfo mi) {
-      return (StorableConversionAttribute)Attribute.GetCustomAttribute(mi, typeof(StorableConversionAttribute), false);
-    }
-    public static Guid GetGuid(MethodInfo mi) {
-      return GetStorableConversionAttribute(mi).Guid;
-    }
-    public static uint GetVersion(MethodInfo mi) {
-      return GetStorableConversionAttribute(mi).Version;
-    }
-    public static IDictionary<string, uint> GetDependencies(MethodInfo mi) {
-      return GetStorableConversionAttribute(mi).Dependencies;
-    }
-  }
-}
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableTypeAttribute.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableTypeAttribute.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableTypeAttribute.cs	(revision 15986)
@@ -37,5 +37,4 @@
 
     public Guid Guid { get; private set; }
-    public uint Version { get; private set; }
 
     /// <summary>
@@ -43,13 +42,11 @@
     /// </summary>
     /// <param name="memberSelection">The storable class memberSelection.</param>
-    public StorableTypeAttribute(StorableMemberSelection memberSelection, string guid, uint version = 1) {
+    public StorableTypeAttribute(StorableMemberSelection memberSelection, string guid) {
       MemberSelection = memberSelection;
       Guid = new Guid(guid);
-      Version = version;
     }
 
-    public StorableTypeAttribute(string guid, uint version = 1) {
+    public StorableTypeAttribute(string guid) {
       Guid = new Guid(guid);
-      Version = version;
     }
 
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs	(revision 15986)
@@ -70,5 +70,6 @@
 
         if (StorableTypeAttribute.MemberSelection != StorableMemberSelection.AllProperties) {
-          var fieldInfos = type.GetFields(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)
+          // TODO: improved performance for static fields
+          var fieldInfos = type.GetFields(BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)
                                .Where(x => !x.Name.StartsWith("<") && !x.Name.EndsWith("k__BackingField")); // exclude backing fields
 
@@ -84,5 +85,6 @@
 
         if (StorableTypeAttribute.MemberSelection != StorableMemberSelection.AllFields) {
-          var propertyInfos = type.GetProperties(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)
+          // TODO: improved performance for static properties
+          var propertyInfos = type.GetProperties(BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)
                                   .Where(x => !x.GetIndexParameters().Any());  // exclude indexed properties
 
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj	(revision 15986)
@@ -65,5 +65,4 @@
     <Compile Include="Core\StorableTypeAttribute.cs" />
     <Compile Include="Core\Transformer.cs" />
-    <Compile Include="Core\StorableConversionAttribute.cs" />
     <Compile Include="Core\TransformerAttribute.cs" />
     <Compile Include="Core\TypeInfo.cs" />
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto	(revision 15986)
@@ -17,6 +17,5 @@
 
   uint32 type_id = 10;
-  uint32 type_version = 11;
-  repeated uint32 generic_type_box_ids = 12;
+  repeated uint32 generic_type_box_ids = 11;
 
   bool bool = 20;
Index: branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 15986)
@@ -48,5 +48,6 @@
 
     public override object ToObject(Box box, Mapper mapper) {
-      return Extract(box, (Type)mapper.GetObject(box.TypeBoxId), mapper);
+      var type = (Type)mapper.GetObject(box.TypeBoxId);
+      return type == null ? default(T) : Extract(box, type, mapper);
     }
 
@@ -80,18 +81,18 @@
         box.TypeId = mapper.GetTypeId(type);
       }
-
-      if (StorableTypeAttribute.IsStorableType(type))
-        box.TypeVersion = StorableTypeAttribute.GetStorableTypeAttribute(type).Version;
     }
 
     public override object ToObject(Box box, Mapper mapper) {
-      return Extract(box, mapper.GetType(box.TypeId), mapper);
+      Type type;
+      return mapper.TryGetType(box.TypeId, out type) ? Extract(box, type, mapper) : null;
     }
 
     private object Extract(Box box, Type type, Mapper mapper) {
       if (type.IsGenericType) {
-        return type.MakeGenericType(box.GenericTypeBoxIds.Select(x => (Type)mapper.GetObject(x)).ToArray());
+        var genericArgumentTypes = box.GenericTypeBoxIds.Select(x => (Type)mapper.GetObject(x)).ToArray();
+        return genericArgumentTypes.Any(x => x == null) ? null : type.MakeGenericType(genericArgumentTypes);
       } else if (type == typeof(Array)) {
-        return ((Type)mapper.GetObject(box.GenericTypeBoxIds[0])).MakeArrayType();
+        var arrayType = (Type)mapper.GetObject(box.GenericTypeBoxIds[0]);
+        return arrayType?.MakeArrayType();
       } else {
         return type;
@@ -526,6 +527,6 @@
         var box = new Box {
           TransformerId = mapper.GetTransformerId(this),
-          TypeId = mapper.GetStringId(o.GetType().AssemblyQualifiedName),
-          UInt = mapper.GetStringId(Enum.Format(o.GetType(), o, "G")),
+          TypeBoxId = mapper.GetBoxId(o.GetType()),
+          UInt = mapper.GetStringId(Enum.Format(o.GetType(), o, "G")) // TODO: introduce old names for enum values to enable refactoring
         };
         return box;
@@ -533,5 +534,6 @@
 
       public override object ToObject(Box box, Mapper mapper) {
-        return Enum.Parse(Type.GetType(mapper.GetString(box.TypeId)), mapper.GetString(box.UInt));
+        var type = (Type)mapper.GetObject(box.TypeBoxId);
+        return type == null ? null : Enum.Parse(type, mapper.GetString(box.UInt));
       }
     }
@@ -784,5 +786,4 @@
     protected override void Populate(Box box, object value, Mapper mapper) {
       var kvps = box.KeyValuePairs;
-      var parentTypeVersions = box.UInts;
       var emptyArgs = new object[0];
 
@@ -815,8 +816,4 @@
         }
 
-        if (type != originalType) {
-          parentTypeVersions.AddRange(new[] { mapper.GetStringId(guid.ToString()), attribute.Version });
-        }
-
         type = type.BaseType;
       }
@@ -829,5 +826,4 @@
     public override void FillFromBox(object obj, Box box, Mapper mapper) {
       var kvps = box.KeyValuePairs;
-      var parentTypeVersions = box.UInts;
       var emptyArgs = new object[0];
 
@@ -840,43 +836,5 @@
 
       var type = (Type)mapper.GetObject(box.TypeBoxId);
-      var typeBox = mapper.GetBox(box.TypeBoxId);
       var typeInfo = Mapper.StaticCache.GetTypeInfo(type);
-
-      var typeVersions = new List<Tuple<Guid, uint>>();
-      typeVersions.Add(Tuple.Create(typeInfo.StorableTypeAttribute.Guid, typeBox.TypeVersion));
-      for (int i = 0; i < parentTypeVersions.Count; i += 2)
-        typeVersions.Add(Tuple.Create(Guid.Parse(mapper.GetString(parentTypeVersions[i])), parentTypeVersions[i + 1]));
-
-      while (true) {
-        var applicableConversion = Mapper.StaticCache.GetStorableConversions(typeVersions).FirstOrDefault();
-        if (applicableConversion == null) break;
-
-        Dictionary<string, object> newDict;
-        List<Tuple<string, uint>> typeChain = null;
-
-        var conversionParameters = applicableConversion.GetParameters();
-        if (conversionParameters.Length == 1) {
-          newDict = (Dictionary<string, object>)applicableConversion.Invoke(null, new object[] { dict });
-        } else if (conversionParameters.Length == 2) {
-          var parameters = new object[] { dict, typeChain };
-          newDict = (Dictionary<string, object>)applicableConversion.Invoke(null, parameters);
-          typeChain = (List<Tuple<string, uint>>)parameters[1];
-        } else throw new PersistenceException("Conversion method has an invalid signature.");
-
-        foreach (var kvp in newDict) dict[kvp.Key] = kvp.Value;
-
-        var convertedType = StorableConversionAttribute.GetGuid(applicableConversion);
-        var convertedVersion = StorableConversionAttribute.GetVersion(applicableConversion);
-
-        var index = typeVersions.FindIndex(x => x.Item1 == convertedType);
-        typeVersions.RemoveAt(index);
-        typeVersions.Insert(index, Tuple.Create(convertedType, convertedVersion + 1));
-
-        if (typeChain != null && typeChain.Any()) {
-          typeVersions.RemoveRange(index + 1, typeVersions.Count - (index + 1));
-          typeVersions.AddRange(typeChain.Select(x => Tuple.Create(Guid.Parse(x.Item1), x.Item2)));
-        }
-      }
-
       var typeStack = new Stack<Tuple<Type, TypeInfo>>();
 
@@ -905,5 +863,5 @@
         }
 
-        // set all members as generated by conversion method chain
+        // set all members
         foreach (var kvp in dict) {
           string key = kvp.Key;
@@ -940,8 +898,4 @@
         //    typeInfo.StorableTypeAttribute.Version,
         //    string.Join(", ", undefinedMembers.Select(x => x.Key))));
-
-        foreach (var hook in typeInfo.AfterDeserializationHooks) {
-          hook.Invoke(obj, emptyArgs);
-        }
       }
     }
Index: branches/PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
===================================================================
--- branches/PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 15878)
+++ branches/PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 15986)
@@ -40,5 +40,4 @@
 using HeuristicLab.Persistence.Default.Xml;
 using HeuristicLab.Persistence.Tests;
-using HeuristicLab.Problems.TestFunctions;
 using HeuristicLab.Tests;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -338,7 +337,7 @@
     }
 
-    public static void RemoveTypeInfo(Type type) {
-      typeInfos.Remove(typeof(ConversionA));
-    }
+    //public static void RemoveTypeInfo(Type type) {
+    //  typeInfos.Remove(typeof(ConversionA));
+    //}
 
     public static Guid GetTypeGuid(Type type) {
@@ -2150,524 +2149,524 @@
     #region conversion
 
-    [StorableType("F9F51075-490C-48E3-BF64-14514A210149", 1)]
-    private class OldBaseType {
-      [Storable]
-      public ItemCollection<IItem> items;
-    }
-    [StorableType("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 1)]
-    private class V1 : OldBaseType {
-      [Storable]
-      public IntValue a;
-
-      [Storable]
-      public ItemList<IntValue> vals;
-
-      [Storable]
-      public V1 mySelf;
-
-      [Storable]
-      public Tuple<int, int> tup;
-
-      [Storable]
-      public int x;
-      [Storable]
-      public int y;
-
-      [Storable]
-      public string s;
-    }
-
-
-    [StorableType("B72C58C8-3321-4706-AA94-578F57337070")]
-    private class NewBaseType {
-      [Storable]
-      public DoubleValue[] items;
-    }
-    [StorableType("00000000-0000-0000-0000-BADCAFFEE001", 2)] // for testing (version 2)
-    private class V2 : NewBaseType {
-      [Storable]
-      public int a;
-
-      [Storable]
-      public int[] val;
-
-      [Storable]
-      public V2 mySelf;
-
-      [Storable]
-      public int TupItem1;
-
-      [Storable]
-      public int TupItem2;
-
-      [Storable]
-      public Point coords;
-
-      [Storable(Name = "s")]
-      public string StorableString { get; set; }
-    }
-
-    [StorableType("00000000-0000-0000-0000-BADCAFFEE002", 3)] // for testing (version 3)
-    private class V3 : NewBaseType {
-      [Storable]
-      public int a;
-
-      [Storable]
-      public int[] val;
-
-      [Storable]
-      public V3 mySelf;
-
-      [Storable]
-      public Tuple<int, int> tup;
-
-      [Storable]
-      public Point coords;
-
-      [Storable(Name = "s", AllowOneWay = true)]
-      public string StorableString { set { PublicString = value; } }
-      public string PublicString { get; set; }
-    }
-
-    private static class Conversions {
-      [StorableConversion("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 1)]
-      private static Dictionary<string, object> ConvertV1(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        var items = (ItemCollection<IItem>)values["F9F51075-490C-48E3-BF64-14514A210149.items"];
-        newValues["B72C58C8-3321-4706-AA94-578F57337070.items"] = items.Select(iv => new DoubleValue((double)(((dynamic)iv).Value))).ToArray();
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"] = ((IntValue)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"]).Value;
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"] = ((ItemList<IntValue>)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.vals"]).Select(iv => iv.Value).ToArray();
-
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"]; // myself type will be mapped correctly
-
-        var tup = (Tuple<int, int>)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.tup"];
-        if (tup != null) {
-          newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem1"] = tup.Item1;
-          newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem2"] = tup.Item2;
-        }
-
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"] = new Point((int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.x"], (int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.y"]);
-
-        return newValues;
-      }
-
-      [StorableConversion("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 2)]
-      private static Dictionary<string, object> ConvertV2(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"];
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"];
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"];
-
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.tup"] = Tuple.Create((int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem1"], (int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem2"]);
-        newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"];
-
-        return newValues;
-      }
-    }
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestConversion() {
-      var test = new Func<V1>(() => {
-        var p = new V1();
-        p.a = new IntValue(1);
-        p.mySelf = p;
-        p.vals = new ItemList<IntValue>(new IntValue[] { p.a, new IntValue(2), new IntValue(3) });
-        p.tup = Tuple.Create(17, 4);
-        var dv = new DoubleValue(1.0);
-        p.items = new ItemCollection<IItem>(new IItem[] { dv, dv, p.a });
-        p.s = "123";
-        return p;
-      });
-
-      ProtoBufSerializer serializer = new ProtoBufSerializer();
-      var old = test();
-      serializer.Serialize(old, tempFile);
-
-      DeregisterType(typeof(V1));
-      DeregisterType(typeof(V2));
-      DeregisterType(typeof(V3));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(V1)).Guid, typeof(V3));
-      SetTypeGuid(typeof(V3), GetTypeGuid(typeof(V1)));
-      RemoveTypeInfo(typeof(V1));
-
-      object o = serializer.Deserialize(tempFile);
-      var restored = (V3)o;
-      Assert.AreEqual(restored.a, old.a.Value);
-      Assert.IsTrue(restored.val.SequenceEqual(old.vals.Select(iv => iv.Value)));
-      Assert.IsTrue(restored.items.Select(item => item.Value).SequenceEqual(old.items.Select(iv => (double)((dynamic)iv).Value)));
-      // Assert.AreSame(restored.items[0], restored.items[1]);
-      Assert.AreSame(restored, restored.mySelf);
-      Assert.AreEqual(restored.PublicString, old.s);
-    }
-
-    #endregion
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestGASerializeDeserializeExecute() {
-      var test = new Func<GeneticAlgorithm>(() => {
-        var ga = new GeneticAlgorithm();
-        ga.Problem = new SingleObjectiveTestFunctionProblem();
-        ga.MaximumGenerations.Value = 100;
-        ga.SetSeedRandomly.Value = false;
-        return ga;
-      });
-      ProtoBufSerializer serializer = new ProtoBufSerializer();
-      GeneticAlgorithm original = test();
-      serializer.Serialize(original, tempFile);
-      object o = serializer.Deserialize(tempFile);
-
-      // this fails because old persistence didn't handle all IComparer ?
-      // Assert.AreEqual(DebugStringGenerator.Serialize(original),DebugStringGenerator.Serialize(o));
-
-      GeneticAlgorithm result = (GeneticAlgorithm)o;
-      SamplesUtils.RunAlgorithm(result);
-      SamplesUtils.RunAlgorithm(original);
-      Assert.AreEqual(((DoubleValue)result.Results["BestQuality"].Value).Value,
-        ((DoubleValue)original.Results["BestQuality"].Value).Value);
-
-      // Assert.AreEqual(DebugStringGenerator.Serialize(result), DebugStringGenerator.Serialize(result2));
-    }
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestLoadingSamples() {
-      var path = @"D:\Dev\Software_HL\branches\PersistenceReintegration\HeuristicLab.Optimizer\3.3\Documents";
-      var serializer = new ProtoBufSerializer();
-      foreach (var fileName in Directory.EnumerateFiles(path, "*.hl")) {
-        var original = XmlParser.Deserialize(fileName);
-        var ok = true;
-        // foreach (var t in original.GetObjectGraphObjects().Select(o => o.GetType())) {
-        //   if (
-        //     t.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
-        //       .Any(ctor => StorableConstructorAttribute.IsStorableConstructor(ctor))) {
-        //     try {
-        //       if (t.IsGenericType) {
-        //         var g = Mapper.StaticCache.GetGuid(t.GetGenericTypeDefinition());
-        //       } else {
-        //         var g = Mapper.StaticCache.GetGuid(t);
-        //       }
-        //     } catch (Exception e) {
-        //       Console.WriteLine(t.FullName);
-        //       ok = false;
-        //     }
-        //   }
-        // }
-        if (ok) {
-          serializer.Serialize(original, fileName + ".proto");
-          // var newVersion = serializer.Deserialize(fileName + ".proto");
-          //Console.WriteLine("File: " + fileName);
-          var p = Profile(() => original, Path.GetFileName(fileName));
-          Console.WriteLine(p);
-        }
-      }
-    }
-
-    [StorableType("3B48A44F-93E2-4ECC-A9B9-56E425EF96F8")]
-    private class ConversionA {
-      [Storable]
-      public int f;
-    }
-
-    [StorableType("00000000-0000-0000-0000-000000000002", 2)]
-    private class ConversionANew {
-      [Storable]
-      public int g;
-    }
-
-    [StorableType("7CBF2251-CF9F-4D9E-AA7B-C65495AE078F")]
-    private class ConversionB : ConversionA {
-      [Storable]
-      public int f;
-      public int BaseF { get { return base.f; } }
-
-      public ConversionB() {
-
-      }
-
-      public ConversionB(int myF, int baseF) {
-        this.f = myF;
-        base.f = baseF;
-      }
-    }
-
-    [StorableType("00000000-0000-0000-0000-000000000001", 2)]
-    private class ConversionBNew : ConversionANew {
-      [Storable]
-      public int g;
-
-      public int BaseG { get { return base.g; } }
-    }
-
-    private static class NewConversions {
-      [StorableConversion("7CBF2251-CF9F-4D9E-AA7B-C65495AE078F", 1)]
-      private static Dictionary<string, object> ConvertB(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["7CBF2251-CF9F-4D9E-AA7B-C65495AE078F.g"] = values["7CBF2251-CF9F-4D9E-AA7B-C65495AE078F.f"];
-        return newValues;
-      }
-
-      [StorableConversion("3B48A44F-93E2-4ECC-A9B9-56E425EF96F8", 1)]
-      private static Dictionary<string, object> ConvertA(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["3B48A44F-93E2-4ECC-A9B9-56E425EF96F8.g"] = values["3B48A44F-93E2-4ECC-A9B9-56E425EF96F8.f"];
-        return newValues;
-      }
-    }
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestConversionCase1() {
-      var test = new Func<ConversionB>(() => {
-        return new ConversionB(1, 2);
-      });
-
-      ProtoBufSerializer serializer = new ProtoBufSerializer();
-      var old = test();
-      serializer.Serialize(old, tempFile);
-
-      DeregisterType(typeof(ConversionB));
-      DeregisterType(typeof(ConversionBNew));
-      DeregisterType(typeof(ConversionA));
-      DeregisterType(typeof(ConversionANew));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(ConversionA)).Guid, typeof(ConversionANew));
-      SetTypeGuid(typeof(ConversionANew), GetTypeGuid(typeof(ConversionA)));
-      RemoveTypeInfo(typeof(ConversionA));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(ConversionB)).Guid, typeof(ConversionBNew));
-      SetTypeGuid(typeof(ConversionBNew), GetTypeGuid(typeof(ConversionB)));
-      RemoveTypeInfo(typeof(ConversionB));
-
-      object o = serializer.Deserialize(tempFile);
-      var restored = (ConversionBNew)o;
-      Assert.AreEqual(restored.g, old.f);
-      Assert.AreEqual(restored.BaseG, old.BaseF);
-    }
-
-    [StorableType("90470973-4559-428E-AF28-DD95866B0A84")]
-    private class A0 {
-      [Storable]
-      public int x;
-    }
-
-    [StorableType("00000000-0000-0000-0000-0000000000A1", 2)]
-    private class A1 {
-      [Storable]
-      public int y;
-    }
-
-    [StorableType("847DD840-3EE3-4A01-AC60-FD7E71ED05F8")]
-    private class B0 {
-      [Storable]
-      public int x;
-    }
-
-    [StorableType("00000000-0000-0000-0000-0000000000B1", 2)]
-    private class B1 : A0 { }
-
-    [StorableType("00000000-0000-0000-0000-0000000000B2", 3)]
-    private class B2 {
-      [Storable]
-      public int x;
-    }
-
-    private static class ConversionsA2A_B2B {
-      [StorableConversion("847DD840-3EE3-4A01-AC60-FD7E71ED05F8", 1, baseGuid: "90470973-4559-428E-AF28-DD95866B0A84", baseVersion: 1)]
-      private static Dictionary<string, object> ConvertB0_B1(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["90470973-4559-428E-AF28-DD95866B0A84.x"] = values["847DD840-3EE3-4A01-AC60-FD7E71ED05F8.x"];
-        return newValues;
-      }
-
-      [StorableConversion("90470973-4559-428E-AF28-DD95866B0A84", 1)]
-      private static Dictionary<string, object> ConvertA0_A1(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["90470973-4559-428E-AF28-DD95866B0A84.y"] = values["90470973-4559-428E-AF28-DD95866B0A84.x"];
-        return newValues;
-      }
-
-      [StorableConversion("847DD840-3EE3-4A01-AC60-FD7E71ED05F8", 2)]
-      private static Dictionary<string, object> ConvertB1_B2(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["847DD840-3EE3-4A01-AC60-FD7E71ED05F8.x"] = values["90470973-4559-428E-AF28-DD95866B0A84.y"];
-        return newValues;
-      }
-    }
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestConversionCase2() {
-      var test = new Func<B0>(() => {
-        return new B0() { x = 17 };
-      });
-
-      ProtoBufSerializer serializer = new ProtoBufSerializer();
-      var old = test();
-      serializer.Serialize(old, tempFile);
-
-      DeregisterType(typeof(B0));
-      DeregisterType(typeof(B1));
-      DeregisterType(typeof(B2));
-      DeregisterType(typeof(A0));
-      DeregisterType(typeof(A1));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(B0)).Guid, typeof(B2));
-      SetTypeGuid(typeof(B2), GetTypeGuid(typeof(B0)));
-      RemoveTypeInfo(typeof(B0));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(A0)).Guid, typeof(A1));
-      SetTypeGuid(typeof(A1), GetTypeGuid(typeof(A0)));
-      RemoveTypeInfo(typeof(A0));
-
-      object o = serializer.Deserialize(tempFile);
-      var restored = (B2)o;
-      Assert.AreEqual(restored.x, old.x);
-    }
-
-    #region Inheritance Chain Test
-    [StorableType("C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95")]
-    private class InheritanceA0 {
-      [Storable]
-      public int x;
-    }
-
-    [StorableType("00000000-0000-0000-0000-0000000001A1", 2)]
-    private class InheritanceA1 {
-      [Storable]
-      public int y;
-    }
-
-    [StorableType("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1)]
-    private class InheritanceC0 {
-      [Storable]
-      public int x;
-    }
-
-    [StorableType("00000000-0000-0000-0000-0000000001C1", 2)]
-    private class InheritanceC1 {
-      [Storable]
-      public int x;
-    }
-
-    [StorableType("41108958-227D-43C4-B049-80AD0D3DB7F6")]
-    private class InheritanceB0 : InheritanceA0 {
-      [Storable]
-      public int x;
-
-      [StorableConstructor]
-      private InheritanceB0(StorableConstructorFlag flag) { }
-      public InheritanceB0(int x) {
-        this.x = x;
-        base.x = x;
-      }
-    }
-
-    [StorableType("00000000-0000-0000-0000-0000000001B1", 2)]
-    private class InheritanceB1 : InheritanceC1 { }
-
-    private static class InheritanceConversionsA2A_B2B {
-      [StorableConversion("C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95", 1)]
-      private static Dictionary<string, object> ConvertA0_A1(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.x"];
-        return newValues;
-      }
-
-      [StorableConversion("41108958-227D-43C4-B049-80AD0D3DB7F6", 1, baseGuid: "C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95", baseVersion: 2)]
-      private static Dictionary<string, object> ConvertB0_B1(Dictionary<string, object> values, out List<Tuple<string, uint>> typeChain) {
-        typeChain = new List<Tuple<string, uint>> {
-          Tuple.Create("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1u)
-        };
-
-        var newValues = new Dictionary<string, object>();
-        newValues["41108958-227D-43C4-B049-80AD0D3DB7F6.x"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"];
-        newValues["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"];
-        return newValues;
-      }
-
-      [StorableConversion("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1)]
-      private static Dictionary<string, object> ConvertC0_C1(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] = (int)values["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] * 2;
-        return newValues;
-      }
-    }
-
-    private static class InheritanceConversionsWithNamesDemo {
-      [StorableConversion("A", 1)]
-      private static Dictionary<string, object> ConvertA1_A2(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["y"] = values["x"];
-        return newValues;
-      }
-
-      [StorableConversion("B", 1, baseGuid: "A", baseVersion: 2)]
-      private static Dictionary<string, object> ConvertB1_B2(Dictionary<string, object> values, out List<Tuple<string, uint>> typeChain) {
-        typeChain = new List<Tuple<string, uint>> {
-          Tuple.Create("C", 1u)
-        };
-
-        var newValues = new Dictionary<string, object>();
-        newValues["x"] = values["A.y"];
-        newValues["C.x"] = values["A.y"];
-        return newValues;
-      }
-
-      [StorableConversion("C", 1)]
-      private static Dictionary<string, object> ConvertC1_C2(Dictionary<string, object> values) {
-        var newValues = new Dictionary<string, object>();
-        newValues["x"] = (int)values["x"] * 2;
-        return newValues;
-      }
-
-      [StorableConversion("C", 1, "D", 1)]
-      [StorableConversion("D", 1, "E", 1)]
-      private static string Rename() { return "D"; }
-    }
-
-    [TestMethod]
-    [TestCategory("PersistenceNew")]
-    [TestProperty("Time", "short")]
-    public void TestInheritanceConversionCase1() {
-      var test = new Func<InheritanceB0>(() => {
-        return new InheritanceB0(17);
-      });
-
-      ProtoBufSerializer serializer = new ProtoBufSerializer();
-      var old = test();
-      serializer.Serialize(old, tempFile);
-
-      DeregisterType(typeof(InheritanceB0));
-      DeregisterType(typeof(InheritanceB1));
-      DeregisterType(typeof(InheritanceA0));
-      DeregisterType(typeof(InheritanceA1));
-      DeregisterType(typeof(InheritanceC0));
-      DeregisterType(typeof(InheritanceC1));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceA0)).Guid, typeof(InheritanceA1));
-      SetTypeGuid(typeof(InheritanceA1), GetTypeGuid(typeof(InheritanceA0)));
-      RemoveTypeInfo(typeof(InheritanceA0));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceB0)).Guid, typeof(InheritanceB1));
-      SetTypeGuid(typeof(InheritanceB1), GetTypeGuid(typeof(InheritanceB0)));
-      RemoveTypeInfo(typeof(InheritanceB0));
-
-      RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceC0)).Guid, typeof(InheritanceC1));
-      SetTypeGuid(typeof(InheritanceC1), GetTypeGuid(typeof(InheritanceC0)));
-      RemoveTypeInfo(typeof(InheritanceC0));
-
-      object o = serializer.Deserialize(tempFile);
-      var restoredC1 = (InheritanceC1)o;
-      var restoredB1 = (InheritanceB1)o;
-      Assert.AreEqual(old.x * 2, restoredC1.x);
-    }
+    //[StorableType("F9F51075-490C-48E3-BF64-14514A210149", 1)]
+    //private class OldBaseType {
+    //  [Storable]
+    //  public ItemCollection<IItem> items;
+    //}
+    //[StorableType("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 1)]
+    //private class V1 : OldBaseType {
+    //  [Storable]
+    //  public IntValue a;
+
+    //  [Storable]
+    //  public ItemList<IntValue> vals;
+
+    //  [Storable]
+    //  public V1 mySelf;
+
+    //  [Storable]
+    //  public Tuple<int, int> tup;
+
+    //  [Storable]
+    //  public int x;
+    //  [Storable]
+    //  public int y;
+
+    //  [Storable]
+    //  public string s;
+    //}
+
+
+    //[StorableType("B72C58C8-3321-4706-AA94-578F57337070")]
+    //private class NewBaseType {
+    //  [Storable]
+    //  public DoubleValue[] items;
+    //}
+    //[StorableType("00000000-0000-0000-0000-BADCAFFEE001", 2)] // for testing (version 2)
+    //private class V2 : NewBaseType {
+    //  [Storable]
+    //  public int a;
+
+    //  [Storable]
+    //  public int[] val;
+
+    //  [Storable]
+    //  public V2 mySelf;
+
+    //  [Storable]
+    //  public int TupItem1;
+
+    //  [Storable]
+    //  public int TupItem2;
+
+    //  [Storable]
+    //  public Point coords;
+
+    //  [Storable(Name = "s")]
+    //  public string StorableString { get; set; }
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-BADCAFFEE002", 3)] // for testing (version 3)
+    //private class V3 : NewBaseType {
+    //  [Storable]
+    //  public int a;
+
+    //  [Storable]
+    //  public int[] val;
+
+    //  [Storable]
+    //  public V3 mySelf;
+
+    //  [Storable]
+    //  public Tuple<int, int> tup;
+
+    //  [Storable]
+    //  public Point coords;
+
+    //  [Storable(Name = "s", AllowOneWay = true)]
+    //  public string StorableString { set { PublicString = value; } }
+    //  public string PublicString { get; set; }
+    //}
+
+    //private static class Conversions {
+    //  [StorableConversion("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 1)]
+    //  private static Dictionary<string, object> ConvertV1(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    var items = (ItemCollection<IItem>)values["F9F51075-490C-48E3-BF64-14514A210149.items"];
+    //    newValues["B72C58C8-3321-4706-AA94-578F57337070.items"] = items.Select(iv => new DoubleValue((double)(((dynamic)iv).Value))).ToArray();
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"] = ((IntValue)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"]).Value;
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"] = ((ItemList<IntValue>)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.vals"]).Select(iv => iv.Value).ToArray();
+
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"]; // myself type will be mapped correctly
+
+    //    var tup = (Tuple<int, int>)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.tup"];
+    //    if (tup != null) {
+    //      newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem1"] = tup.Item1;
+    //      newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem2"] = tup.Item2;
+    //    }
+
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"] = new Point((int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.x"], (int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.y"]);
+
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("D211A828-6440-4E72-A8C7-AA4F9B4FFA75", 2)]
+    //  private static Dictionary<string, object> ConvertV2(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.a"];
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.val"];
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.mySelf"];
+
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.tup"] = Tuple.Create((int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem1"], (int)values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.TupItem2"]);
+    //    newValues["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"] = values["D211A828-6440-4E72-A8C7-AA4F9B4FFA75.coords"];
+
+    //    return newValues;
+    //  }
+    //}
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestConversion() {
+    //  var test = new Func<V1>(() => {
+    //    var p = new V1();
+    //    p.a = new IntValue(1);
+    //    p.mySelf = p;
+    //    p.vals = new ItemList<IntValue>(new IntValue[] { p.a, new IntValue(2), new IntValue(3) });
+    //    p.tup = Tuple.Create(17, 4);
+    //    var dv = new DoubleValue(1.0);
+    //    p.items = new ItemCollection<IItem>(new IItem[] { dv, dv, p.a });
+    //    p.s = "123";
+    //    return p;
+    //  });
+
+    //  ProtoBufSerializer serializer = new ProtoBufSerializer();
+    //  var old = test();
+    //  serializer.Serialize(old, tempFile);
+
+    //  DeregisterType(typeof(V1));
+    //  DeregisterType(typeof(V2));
+    //  DeregisterType(typeof(V3));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(V1)).Guid, typeof(V3));
+    //  SetTypeGuid(typeof(V3), GetTypeGuid(typeof(V1)));
+    //  RemoveTypeInfo(typeof(V1));
+
+    //  object o = serializer.Deserialize(tempFile);
+    //  var restored = (V3)o;
+    //  Assert.AreEqual(restored.a, old.a.Value);
+    //  Assert.IsTrue(restored.val.SequenceEqual(old.vals.Select(iv => iv.Value)));
+    //  Assert.IsTrue(restored.items.Select(item => item.Value).SequenceEqual(old.items.Select(iv => (double)((dynamic)iv).Value)));
+    //  // Assert.AreSame(restored.items[0], restored.items[1]);
+    //  Assert.AreSame(restored, restored.mySelf);
+    //  Assert.AreEqual(restored.PublicString, old.s);
+    //}
+
+    //#endregion
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestGASerializeDeserializeExecute() {
+    //  var test = new Func<GeneticAlgorithm>(() => {
+    //    var ga = new GeneticAlgorithm();
+    //    ga.Problem = new SingleObjectiveTestFunctionProblem();
+    //    ga.MaximumGenerations.Value = 100;
+    //    ga.SetSeedRandomly.Value = false;
+    //    return ga;
+    //  });
+    //  ProtoBufSerializer serializer = new ProtoBufSerializer();
+    //  GeneticAlgorithm original = test();
+    //  serializer.Serialize(original, tempFile);
+    //  object o = serializer.Deserialize(tempFile);
+
+    //  // this fails because old persistence didn't handle all IComparer ?
+    //  // Assert.AreEqual(DebugStringGenerator.Serialize(original),DebugStringGenerator.Serialize(o));
+
+    //  GeneticAlgorithm result = (GeneticAlgorithm)o;
+    //  SamplesUtils.RunAlgorithm(result);
+    //  SamplesUtils.RunAlgorithm(original);
+    //  Assert.AreEqual(((DoubleValue)result.Results["BestQuality"].Value).Value,
+    //    ((DoubleValue)original.Results["BestQuality"].Value).Value);
+
+    //  // Assert.AreEqual(DebugStringGenerator.Serialize(result), DebugStringGenerator.Serialize(result2));
+    //}
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestLoadingSamples() {
+    //  var path = @"C:\Dev\Software_HL\branches\PersistenceReintegration\HeuristicLab.Optimizer\3.3\Documents";
+    //  var serializer = new ProtoBufSerializer();
+    //  foreach (var fileName in Directory.EnumerateFiles(path, "*.hl")) {
+    //    var original = XmlParser.Deserialize(fileName);
+    //    var ok = true;
+    //    // foreach (var t in original.GetObjectGraphObjects().Select(o => o.GetType())) {
+    //    //   if (
+    //    //     t.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
+    //    //       .Any(ctor => StorableConstructorAttribute.IsStorableConstructor(ctor))) {
+    //    //     try {
+    //    //       if (t.IsGenericType) {
+    //    //         var g = Mapper.StaticCache.GetGuid(t.GetGenericTypeDefinition());
+    //    //       } else {
+    //    //         var g = Mapper.StaticCache.GetGuid(t);
+    //    //       }
+    //    //     } catch (Exception e) {
+    //    //       Console.WriteLine(t.FullName);
+    //    //       ok = false;
+    //    //     }
+    //    //   }
+    //    // }
+    //    if (ok) {
+    //      serializer.Serialize(original, fileName + ".proto");
+    //      // var newVersion = serializer.Deserialize(fileName + ".proto");
+    //      //Console.WriteLine("File: " + fileName);
+    //      var p = Profile(() => original, Path.GetFileName(fileName));
+    //      Console.WriteLine(p);
+    //    }
+    //  }
+    //}
+
+    //[StorableType("3B48A44F-93E2-4ECC-A9B9-56E425EF96F8")]
+    //private class ConversionA {
+    //  [Storable]
+    //  public int f;
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-000000000002", 2)]
+    //private class ConversionANew {
+    //  [Storable]
+    //  public int g;
+    //}
+
+    //[StorableType("7CBF2251-CF9F-4D9E-AA7B-C65495AE078F")]
+    //private class ConversionB : ConversionA {
+    //  [Storable]
+    //  public int f;
+    //  public int BaseF { get { return base.f; } }
+
+    //  public ConversionB() {
+
+    //  }
+
+    //  public ConversionB(int myF, int baseF) {
+    //    this.f = myF;
+    //    base.f = baseF;
+    //  }
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-000000000001", 2)]
+    //private class ConversionBNew : ConversionANew {
+    //  [Storable]
+    //  public int g;
+
+    //  public int BaseG { get { return base.g; } }
+    //}
+
+    //private static class NewConversions {
+    //  [StorableConversion("7CBF2251-CF9F-4D9E-AA7B-C65495AE078F", 1)]
+    //  private static Dictionary<string, object> ConvertB(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["7CBF2251-CF9F-4D9E-AA7B-C65495AE078F.g"] = values["7CBF2251-CF9F-4D9E-AA7B-C65495AE078F.f"];
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("3B48A44F-93E2-4ECC-A9B9-56E425EF96F8", 1)]
+    //  private static Dictionary<string, object> ConvertA(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["3B48A44F-93E2-4ECC-A9B9-56E425EF96F8.g"] = values["3B48A44F-93E2-4ECC-A9B9-56E425EF96F8.f"];
+    //    return newValues;
+    //  }
+    //}
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestConversionCase1() {
+    //  var test = new Func<ConversionB>(() => {
+    //    return new ConversionB(1, 2);
+    //  });
+
+    //  ProtoBufSerializer serializer = new ProtoBufSerializer();
+    //  var old = test();
+    //  serializer.Serialize(old, tempFile);
+
+    //  DeregisterType(typeof(ConversionB));
+    //  DeregisterType(typeof(ConversionBNew));
+    //  DeregisterType(typeof(ConversionA));
+    //  DeregisterType(typeof(ConversionANew));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(ConversionA)).Guid, typeof(ConversionANew));
+    //  SetTypeGuid(typeof(ConversionANew), GetTypeGuid(typeof(ConversionA)));
+    //  RemoveTypeInfo(typeof(ConversionA));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(ConversionB)).Guid, typeof(ConversionBNew));
+    //  SetTypeGuid(typeof(ConversionBNew), GetTypeGuid(typeof(ConversionB)));
+    //  RemoveTypeInfo(typeof(ConversionB));
+
+    //  object o = serializer.Deserialize(tempFile);
+    //  var restored = (ConversionBNew)o;
+    //  Assert.AreEqual(restored.g, old.f);
+    //  Assert.AreEqual(restored.BaseG, old.BaseF);
+    //}
+
+    //[StorableType("90470973-4559-428E-AF28-DD95866B0A84")]
+    //private class A0 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-0000000000A1", 2)]
+    //private class A1 {
+    //  [Storable]
+    //  public int y;
+    //}
+
+    //[StorableType("847DD840-3EE3-4A01-AC60-FD7E71ED05F8")]
+    //private class B0 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-0000000000B1", 2)]
+    //private class B1 : A0 { }
+
+    //[StorableType("00000000-0000-0000-0000-0000000000B2", 3)]
+    //private class B2 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //private static class ConversionsA2A_B2B {
+    //  [StorableConversion("847DD840-3EE3-4A01-AC60-FD7E71ED05F8", 1, baseGuid: "90470973-4559-428E-AF28-DD95866B0A84", baseVersion: 1)]
+    //  private static Dictionary<string, object> ConvertB0_B1(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["90470973-4559-428E-AF28-DD95866B0A84.x"] = values["847DD840-3EE3-4A01-AC60-FD7E71ED05F8.x"];
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("90470973-4559-428E-AF28-DD95866B0A84", 1)]
+    //  private static Dictionary<string, object> ConvertA0_A1(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["90470973-4559-428E-AF28-DD95866B0A84.y"] = values["90470973-4559-428E-AF28-DD95866B0A84.x"];
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("847DD840-3EE3-4A01-AC60-FD7E71ED05F8", 2)]
+    //  private static Dictionary<string, object> ConvertB1_B2(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["847DD840-3EE3-4A01-AC60-FD7E71ED05F8.x"] = values["90470973-4559-428E-AF28-DD95866B0A84.y"];
+    //    return newValues;
+    //  }
+    //}
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestConversionCase2() {
+    //  var test = new Func<B0>(() => {
+    //    return new B0() { x = 17 };
+    //  });
+
+    //  ProtoBufSerializer serializer = new ProtoBufSerializer();
+    //  var old = test();
+    //  serializer.Serialize(old, tempFile);
+
+    //  DeregisterType(typeof(B0));
+    //  DeregisterType(typeof(B1));
+    //  DeregisterType(typeof(B2));
+    //  DeregisterType(typeof(A0));
+    //  DeregisterType(typeof(A1));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(B0)).Guid, typeof(B2));
+    //  SetTypeGuid(typeof(B2), GetTypeGuid(typeof(B0)));
+    //  RemoveTypeInfo(typeof(B0));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(A0)).Guid, typeof(A1));
+    //  SetTypeGuid(typeof(A1), GetTypeGuid(typeof(A0)));
+    //  RemoveTypeInfo(typeof(A0));
+
+    //  object o = serializer.Deserialize(tempFile);
+    //  var restored = (B2)o;
+    //  Assert.AreEqual(restored.x, old.x);
+    //}
+
+    //#region Inheritance Chain Test
+    //[StorableType("C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95")]
+    //private class InheritanceA0 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-0000000001A1", 2)]
+    //private class InheritanceA1 {
+    //  [Storable]
+    //  public int y;
+    //}
+
+    //[StorableType("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1)]
+    //private class InheritanceC0 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-0000000001C1", 2)]
+    //private class InheritanceC1 {
+    //  [Storable]
+    //  public int x;
+    //}
+
+    //[StorableType("41108958-227D-43C4-B049-80AD0D3DB7F6")]
+    //private class InheritanceB0 : InheritanceA0 {
+    //  [Storable]
+    //  public int x;
+
+    //  [StorableConstructor]
+    //  private InheritanceB0(StorableConstructorFlag flag) { }
+    //  public InheritanceB0(int x) {
+    //    this.x = x;
+    //    base.x = x;
+    //  }
+    //}
+
+    //[StorableType("00000000-0000-0000-0000-0000000001B1", 2)]
+    //private class InheritanceB1 : InheritanceC1 { }
+
+    //private static class InheritanceConversionsA2A_B2B {
+    //  [StorableConversion("C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95", 1)]
+    //  private static Dictionary<string, object> ConvertA0_A1(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.x"];
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("41108958-227D-43C4-B049-80AD0D3DB7F6", 1, baseGuid: "C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95", baseVersion: 2)]
+    //  private static Dictionary<string, object> ConvertB0_B1(Dictionary<string, object> values, out List<Tuple<string, uint>> typeChain) {
+    //    typeChain = new List<Tuple<string, uint>> {
+    //      Tuple.Create("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1u)
+    //    };
+
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["41108958-227D-43C4-B049-80AD0D3DB7F6.x"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"];
+    //    newValues["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] = values["C1BFC249-89F6-45E2-8DFB-DA95E1BE9B95.y"];
+    //    return newValues;
+    //  }
+
+    //  [StorableConversion("28A5F6B8-49AF-4C6A-AF0E-F92EB4511722", 1)]
+    //  private static Dictionary<string, object> ConvertC0_C1(Dictionary<string, object> values) {
+    //    var newValues = new Dictionary<string, object>();
+    //    newValues["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] = (int)values["28A5F6B8-49AF-4C6A-AF0E-F92EB4511722.x"] * 2;
+    //    return newValues;
+    //  }
+    //}
+
+    ////private static class InheritanceConversionsWithNamesDemo {
+    ////  [StorableConversion("A", 1)]
+    ////  private static Dictionary<string, object> ConvertA1_A2(Dictionary<string, object> values) {
+    ////    var newValues = new Dictionary<string, object>();
+    ////    newValues["y"] = values["x"];
+    ////    return newValues;
+    ////  }
+
+    ////  [StorableConversion("B", 1, baseGuid: "A", baseVersion: 2)]
+    ////  private static Dictionary<string, object> ConvertB1_B2(Dictionary<string, object> values, out List<Tuple<string, uint>> typeChain) {
+    ////    typeChain = new List<Tuple<string, uint>> {
+    ////      Tuple.Create("C", 1u)
+    ////    };
+
+    ////    var newValues = new Dictionary<string, object>();
+    ////    newValues["x"] = values["A.y"];
+    ////    newValues["C.x"] = values["A.y"];
+    ////    return newValues;
+    ////  }
+
+    ////  [StorableConversion("C", 1)]
+    ////  private static Dictionary<string, object> ConvertC1_C2(Dictionary<string, object> values) {
+    ////    var newValues = new Dictionary<string, object>();
+    ////    newValues["x"] = (int)values["x"] * 2;
+    ////    return newValues;
+    ////  }
+
+    ////  [StorableConversion("C", 1, "D", 1)]
+    ////  //[StorableConversion("D", 1, "E", 1)]
+    ////  private static string Rename() { return "D"; }
+    ////}
+
+    //[TestMethod]
+    //[TestCategory("PersistenceNew")]
+    //[TestProperty("Time", "short")]
+    //public void TestInheritanceConversionCase1() {
+    //  var test = new Func<InheritanceB0>(() => {
+    //    return new InheritanceB0(17);
+    //  });
+
+    //  ProtoBufSerializer serializer = new ProtoBufSerializer();
+    //  var old = test();
+    //  serializer.Serialize(old, tempFile);
+
+    //  DeregisterType(typeof(InheritanceB0));
+    //  DeregisterType(typeof(InheritanceB1));
+    //  DeregisterType(typeof(InheritanceA0));
+    //  DeregisterType(typeof(InheritanceA1));
+    //  DeregisterType(typeof(InheritanceC0));
+    //  DeregisterType(typeof(InheritanceC1));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceA0)).Guid, typeof(InheritanceA1));
+    //  SetTypeGuid(typeof(InheritanceA1), GetTypeGuid(typeof(InheritanceA0)));
+    //  RemoveTypeInfo(typeof(InheritanceA0));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceB0)).Guid, typeof(InheritanceB1));
+    //  SetTypeGuid(typeof(InheritanceB1), GetTypeGuid(typeof(InheritanceB0)));
+    //  RemoveTypeInfo(typeof(InheritanceB0));
+
+    //  RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(InheritanceC0)).Guid, typeof(InheritanceC1));
+    //  SetTypeGuid(typeof(InheritanceC1), GetTypeGuid(typeof(InheritanceC0)));
+    //  RemoveTypeInfo(typeof(InheritanceC0));
+
+    //  object o = serializer.Deserialize(tempFile);
+    //  var restoredC1 = (InheritanceC1)o;
+    //  var restoredB1 = (InheritanceB1)o;
+    //  Assert.AreEqual(old.x * 2, restoredC1.x);
+    //}
     #endregion
     #endregion
