Index: /branches/PersistenceOverhaul/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs	(revision 13386)
@@ -541,5 +541,5 @@
 
   [Item("Hive Task", "Represents a hive task.")]
-  [StorableClass("967DC1A1-7B0C-4D8B-AF9F-710B1FD676DF")]
+  [StorableClass("04AD6AF8-8248-48FB-AF3A-403A2D22F725")]
   public class HiveTask<T> : HiveTask where T : ItemTask {
 
Index: /branches/PersistenceOverhaul/HeuristicLab.Collections/3.3/BidirectionalLookup.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Collections/3.3/BidirectionalLookup.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Collections/3.3/BidirectionalLookup.cs	(revision 13386)
@@ -26,5 +26,5 @@
 
 namespace HeuristicLab.Collections {
-  [StorableClass("066A8A8B-784D-45CC-9063-F2FC8E9A4442")]
+  [StorableClass("0BF45891-847C-428B-9F2C-FD682320066C")]
   [Serializable]
   public class BidirectionalLookup<TFirst, TSecond> {
Index: /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Arc.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Arc.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Arc.cs	(revision 13386)
@@ -26,5 +26,5 @@
 namespace HeuristicLab.Core {
   [Item("Arc", "A graph arc connecting two graph vertices, that can have a weight, label, and data object for holding additional info")]
-  [StorableClass("9C41B31C-E208-46A2-87FC-45A9F0A9A928")]
+  [StorableClass("B9E1D948-BCEF-4B07-AADD-2E39A80F15DF")]
   public class Arc : Item, IArc {
     [Storable]
Index: /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs	(revision 13386)
@@ -28,5 +28,5 @@
 namespace HeuristicLab.Core {
   [Item("Vertex", "An object representing a vertex in the graph. It can have a text label, a weight, and an additional data object.")]
-  [StorableClass("0B8261A0-8829-4BB8-B7EF-940A9A0AB1D9")]
+  [StorableClass("DC0C1D1F-82DF-4150-94CC-A10FD3667F72")]
   public class Vertex : Item, IVertex {
     [Storable]
Index: /branches/PersistenceOverhaul/HeuristicLab.Operators/3.3/StochasticMultiBranch.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Operators/3.3/StochasticMultiBranch.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Operators/3.3/StochasticMultiBranch.cs	(revision 13386)
@@ -35,5 +35,5 @@
   /// </summary>
   [Item("StochasticMultiBranch", "Selects one of its branches (if there are any) given a list of relative probabilities.")]
-  [StorableClass("7DE99E47-6B7D-4AE3-A8B8-0D7C9B82F3EE")]
+  [StorableClass("7FF6CB0B-F831-4A97-A8D3-40EBF6BE78B6")]
   public abstract class StochasticMultiBranch<T> : CheckedMultiOperator<T> where T : class, IOperator {
     /// <summary>
Index: /branches/PersistenceOverhaul/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs	(revision 13386)
@@ -235,5 +235,5 @@
 
     [Item("EmptyUserDefinedProblemEvaluator", "A dummy evaluator that will throw an exception when executed.")]
-    [StorableClass("F3DF503B-3FCA-4A80-B5E8-776699E6F13E")]
+    [StorableClass("00D4B39A-2E69-4842-9045-6E9D8F01F6EB")]
     [NonDiscoverableType]
     private sealed class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator {
Index: /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 13386)
Index: /branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicNearestNeighbourClassificationModel.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicNearestNeighbourClassificationModel.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicNearestNeighbourClassificationModel.cs	(revision 13386)
@@ -32,5 +32,5 @@
   /// Represents a nearest neighbour model for regression and classification
   /// </summary>
-  [StorableClass("01561669-12E6-4C75-86BF-88C24DA53FDD")]
+  [StorableClass("225CCF16-C932-4D18-AF5A-0745FAD8F22C")]
   [Item("SymbolicNearestNeighbourClassificationModel", "Represents a nearest neighbour model for symbolic classification.")]
   public sealed class SymbolicNearestNeighbourClassificationModel : SymbolicClassificationModel {
Index: /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/StorableAttributeTests.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/StorableAttributeTests.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/StorableAttributeTests.cs	(revision 13386)
@@ -24,5 +24,5 @@
 namespace HeuristicLab.Persistence.Tests {
 
-  [StorableClass("2CD1E9C4-DDBA-458D-ADDA-5649A48AD564")]
+  [StorableClass("E6CE21DC-FEA3-4763-BA60-CE8EB6B8E539")]
   class DemoClass {
 
@@ -36,5 +36,5 @@
   }
 
-  [StorableClass("2CD1E9C4-DDBA-458D-ADDA-5649A48AD564")]
+  [StorableClass("32FDC5F4-E5AD-4119-90E0-6D14785E87FD")]
   class Base {
     public string baseName;
@@ -46,5 +46,5 @@
   }
 
-  [StorableClass("2CD1E9C4-DDBA-458D-ADDA-5649A48AD564")]
+  [StorableClass("F2151C9F-FD83-4D6F-B987-08DF723158DB")]
   class Override : Base {
     [Storable]
@@ -55,9 +55,9 @@
   }
 
-  [StorableClass("2CD1E9C4-DDBA-458D-ADDA-5649A48AD564")]
+  [StorableClass("647B2E77-EC1E-458F-AB9D-ACFA8248352A")]
   class Intermediate : Override {
   }
 
-  [StorableClass("2CD1E9C4-DDBA-458D-ADDA-5649A48AD564")]
+  [StorableClass("AEAC61FF-896F-418C-82C8-33F0548AF3B2")]
   class New : Intermediate {
     public string newName;
Index: /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCases.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCases.cs	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCases.cs	(revision 13386)
@@ -46,5 +46,5 @@
 namespace HeuristicLab.Persistence.Tests {
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("777E5793-7389-4109-A617-D7D6EB74A2C7")]
   public class NumberTest {
     [Storable]
@@ -95,5 +95,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("2911C342-74AB-4B47-9840-87F012AEF0C1")]
   public class NonDefaultConstructorClass {
     [Storable]
@@ -104,5 +104,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("8621F4FA-8711-4DA4-A50B-7D04683440B8")]
   public class IntWrapper {
 
@@ -127,5 +127,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("0B93C65E-1A4C-45DD-B40D-7614BA2B2ABA")]
   public class PrimitivesTest : NumberTest {
     [Storable]
@@ -159,5 +159,5 @@
   public enum TestEnum { va1, va2, va3, va8 } ;
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("0DA4A6A5-0280-4F3C-80DA-0AB09461F66C")]
   public class RootBase {
     [Storable]
@@ -178,5 +178,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("12CC2626-A1E2-45A5-9761-902333C88CCF")]
   public class Root : RootBase {
     [Storable]
@@ -213,5 +213,5 @@
   public enum TrickyEnum { zero = 0, one = 1, two = 2 }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("04BFD8AF-AB93-457A-B5CD-F2AB2B18874F")]
   public class EnumTest {
     [Storable]
@@ -223,5 +223,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("41E5C615-82A6-4844-B6A4-4DB8ED8C03D8")]
   public class Custom {
     [Storable]
@@ -233,5 +233,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("3D2455E6-0AD9-4141-B44A-759F71491443")]
   public class Manager {
 
@@ -246,5 +246,5 @@
   }
 
-  [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+  [StorableClass("D8D40F6E-91DC-4E20-8154-F95C0AF32CC8")]
   public class C {
     [Storable]
@@ -486,5 +486,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("B2C78E8F-32F9-43BE-9DED-219F102125EB")]
     public class NestedType {
       [Storable]
@@ -692,5 +692,5 @@
       l.Add(new NonSerializable());
       try {
-        Serializer s = new Serializer(l,
+        HeuristicLab.Persistence.Core.Serializer s = new HeuristicLab.Persistence.Core.Serializer(l,
           ConfigurationService.Instance.GetConfiguration(new XmlFormat()),
           "ROOT", true);
@@ -711,5 +711,5 @@
     public void TestAssemblyVersionCheck() {
       IntWrapper i = new IntWrapper(1);
-      Serializer s = new Serializer(i, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
+      HeuristicLab.Persistence.Core.Serializer s = new HeuristicLab.Persistence.Core.Serializer(i, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
       XmlGenerator g = new XmlGenerator();
       StringBuilder dataString = new StringBuilder();
@@ -758,5 +758,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("2B2FE809-CDA4-4BCD-BF4C-35F757678AB9")]
     class Child {
       [Storable]
@@ -764,5 +764,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("C8F4E805-26DF-4129-910E-F7F51E4DDE41")]
     class Parent {
       [Storable]
@@ -770,5 +770,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("0CF63740-F8C1-46EE-A3A0-7E350A8EBAA1")]
     class GrandParent {
       [Storable]
@@ -848,5 +848,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("F5920537-7F03-41C4-8061-8F8D7CDDB6BE")]
     private class PersistenceHooks {
       [Storable]
@@ -885,5 +885,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("935C5ECB-ACEF-48EA-93BC-4B4177DFE0A5")]
     private class CustomConstructor {
       public string Value = "none";
@@ -909,5 +909,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("31D7CE01-E390-40CF-B9BF-BD79A8F850DA")]
     public class ExplodingDefaultConstructor {
       public ExplodingDefaultConstructor() {
@@ -961,5 +961,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("9DEE1F8F-320C-401B-8103-65FBA6BD4F07")]
     public class HookInheritanceTestBase {
       [Storable]
@@ -972,5 +972,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("97DF2931-2B23-4FAA-8E59-806FA58ADAED")]
     public class HookInheritanceTestDerivedClass : HookInheritanceTestBase {
       [Storable]
@@ -994,5 +994,5 @@
     }
 
-    [StorableClass(StorableClassType.AllFields, "B9AB42E8-1932-425B-B4CF-F31F07EAC599")]
+    [StorableClass(StorableClassType.AllFields, "6207E4E1-4CFC-4890-9741-33B7E1E43F26")]
     public class AllFieldsStorable {
       public int Value1 = 1;
@@ -1025,5 +1025,5 @@
     }
 
-    [StorableClass(StorableClassType.AllProperties, "CB7DC31C-AEF3-4EB8-91CA-248B767E9F92")]
+    [StorableClass(StorableClassType.AllProperties, "ADDB5A7C-4BA9-4E5F-BFAF-2B48C8646808")]
     public class AllPropertiesStorable {
       public int Value1 = 1;
@@ -1057,5 +1057,5 @@
     }
 
-    [StorableClass(StorableClassType.AllFieldsAndAllProperties, "0AD8D68F-E0FF-4FA8-8A72-1148CD91A2B9")]
+    [StorableClass(StorableClassType.AllFieldsAndAllProperties, "9C6136CB-A9AC-4527-B41A-7A2DB50ACE53")]
     public class AllFieldsAndAllPropertiesStorable {
       public int Value1 = 1;
@@ -1088,5 +1088,5 @@
     }
 
-    [StorableClass(StorableClassType.MarkedOnly, "0D94E6D4-64E3-4637-B1EE-DEF2B3F6E2E0")]
+    [StorableClass(StorableClassType.MarkedOnly, "75C9F6F0-1B2E-41E7-A327-AF9CF5C87D8D")]
     public class MarkedOnlyStorable {
       public int Value1 = 1;
@@ -1248,5 +1248,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("A603ABE6-86DB-46F7-AF87-C7B40E4FF169")]
     public class ReadOnlyFail {
       [Storable]
@@ -1272,5 +1272,5 @@
 
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("7EDE1D86-C8F5-4B51-846F-1634C0FE20BB")]
     public class WriteOnlyFail {
       [Storable]
@@ -1295,5 +1295,5 @@
     }
 
-    [StorableClass("3B2B27A5-3F0A-44ED-8672-0E89C9618026")]
+    [StorableClass("65B13830-5D60-4C3F-8D9E-5DCDF1E3A977")]
     public class OneWayTest {
       public OneWayTest() { this.value = "default"; }
@@ -1314,5 +1314,5 @@
     public void TestOneWaySerialization() {
       var test = new OneWayTest();
-      var serializer = new Serializer(test, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
+      var serializer = new HeuristicLab.Persistence.Core.Serializer(test, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
       var it = serializer.GetEnumerator();
       it.MoveNext();
Index: /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 13386)
+++ /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 13386)
@@ -0,0 +1,1456 @@
+#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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.Algorithms.GeneticAlgorithm;
+using HeuristicLab.Persistence;
+using HeuristicLab.Persistence.Auxiliary;
+using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Persistence.Default.DebugString;
+using HeuristicLab.Persistence.Default.Xml;
+using HeuristicLab.Persistence.Tests;
+using HeuristicLab.Tests;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.PersistenceNew.Tests {
+  #region Test Classes
+  [StorableClass("7D9672BD-703D-42BB-9080-9929885D4580")]
+  public class NumberTest {
+    [Storable]
+    private bool _bool = true;
+    [Storable]
+    private byte _byte = 0xFF;
+    [Storable]
+    private sbyte _sbyte = 0xF;
+    [Storable]
+    private short _short = -123;
+    [Storable]
+    private ushort _ushort = 123;
+    [Storable]
+    private int _int = -123;
+    [Storable]
+    private uint _uint = 123;
+    [Storable]
+    private long _long = 123456;
+    [Storable]
+    private ulong _ulong = 123456;
+    public override bool Equals(object obj) {
+      NumberTest nt = obj as NumberTest;
+      if (nt == null)
+        throw new NotSupportedException();
+      return
+        nt._bool == _bool &&
+        nt._byte == _byte &&
+        nt._sbyte == _sbyte &&
+        nt._short == _short &&
+        nt._ushort == _ushort &&
+        nt._int == _int &&
+        nt._uint == _uint &&
+        nt._long == _long &&
+        nt._ulong == _ulong;
+    }
+    public override int GetHashCode() {
+      return
+        _bool.GetHashCode() ^
+        _byte.GetHashCode() ^
+        _sbyte.GetHashCode() ^
+        _short.GetHashCode() ^
+        _short.GetHashCode() ^
+        _int.GetHashCode() ^
+        _uint.GetHashCode() ^
+        _long.GetHashCode() ^
+        _ulong.GetHashCode();
+    }
+  }
+
+  [StorableClass("EEB19599-D5AC-48ED-A56B-CF213DFAF2E4")]
+  public class NonDefaultConstructorClass {
+    [Storable]
+    int value;
+    public NonDefaultConstructorClass(int value) {
+      this.value = value;
+    }
+  }
+
+  [StorableClass("EE43FE7A-6D07-4D52-9338-C21B3485F82A")]
+  public class IntWrapper {
+
+    [Storable]
+    public int Value;
+
+    private IntWrapper() { }
+
+    public IntWrapper(int value) {
+      this.Value = value;
+    }
+
+    public override bool Equals(object obj) {
+      if (obj as IntWrapper == null)
+        return false;
+      return Value.Equals(((IntWrapper)obj).Value);
+    }
+    public override int GetHashCode() {
+      return Value.GetHashCode();
+    }
+
+  }
+
+  [StorableClass("00A8E48E-8E8A-443C-A327-9F6ACCBE7E80")]
+  public class PrimitivesTest : NumberTest {
+    [Storable]
+    private char c = 'e';
+    [Storable]
+    private long[,] _long_array =
+      new long[,] { { 123, 456, }, { 789, 123 } };
+    [Storable]
+    public List<int> list = new List<int> { 1, 2, 3, 4, 5 };
+    [Storable]
+    private object o = new object();
+    public override bool Equals(object obj) {
+      PrimitivesTest pt = obj as PrimitivesTest;
+      if (pt == null)
+        throw new NotSupportedException();
+      return base.Equals(obj) &&
+        c == pt.c &&
+        _long_array == pt._long_array &&
+        list == pt.list &&
+        o == pt.o;
+    }
+    public override int GetHashCode() {
+      return base.GetHashCode() ^
+        c.GetHashCode() ^
+        _long_array.GetHashCode() ^
+        list.GetHashCode() ^
+        o.GetHashCode();
+    }
+  }
+
+  public enum TestEnum { va1, va2, va3, va8 } ;
+
+  [StorableClass("26BA37F6-926D-4665-A10A-1F39E1CF6468")]
+  public class RootBase {
+    [Storable]
+    private string baseString = "   Serial  ";
+    [Storable]
+    public TestEnum myEnum = TestEnum.va3;
+    public override bool Equals(object obj) {
+      RootBase rb = obj as RootBase;
+      if (rb == null)
+        throw new NotSupportedException();
+      return baseString == rb.baseString &&
+        myEnum == rb.myEnum;
+    }
+    public override int GetHashCode() {
+      return baseString.GetHashCode() ^
+        myEnum.GetHashCode();
+    }
+  }
+
+  [StorableClass("F6BCB436-B5F2-40F6-8E2F-7A018CD1CBA0")]
+  public class Root : RootBase {
+    [Storable]
+    public Stack<int> intStack = new Stack<int>();
+    [Storable]
+    public int[] i = new[] { 3, 4, 5, 6 };
+    [Storable(Name = "Test String")]
+    public string s;
+    [Storable]
+    public ArrayList intArray = new ArrayList(new[] { 1, 2, 3 });
+    [Storable]
+    public List<int> intList = new List<int>(new[] { 321, 312, 321 });
+    [Storable]
+    public Custom c;
+    [Storable]
+    public List<Root> selfReferences;
+    [Storable]
+    public double[,] multiDimArray = new double[,] { { 1, 2, 3 }, { 3, 4, 5 } };
+    [Storable]
+    public bool boolean = true;
+    [Storable]
+    public DateTime dateTime;
+    [Storable]
+    public KeyValuePair<string, int> kvp = new KeyValuePair<string, int>("Serial", 123);
+    [Storable]
+    public Dictionary<string, int> dict = new Dictionary<string, int>();
+    [Storable(DefaultValue = "default")]
+    public string uninitialized;
+  }
+
+  public enum SimpleEnum { one, two, three }
+  public enum ComplexEnum { one = 1, two = 2, three = 3 }
+  [FlagsAttribute]
+  public enum TrickyEnum { zero = 0, one = 1, two = 2 }
+
+  [StorableClass("2F6326ED-023A-415F-B5C7-9F9241940D05")]
+  public class EnumTest {
+    [Storable]
+    public SimpleEnum simpleEnum = SimpleEnum.one;
+    [Storable]
+    public ComplexEnum complexEnum = (ComplexEnum)2;
+    [Storable]
+    public TrickyEnum trickyEnum = (TrickyEnum)15;
+  }
+
+  [StorableClass("92365E2A-1184-4280-B763-4853C7ADF3E3")]
+  public class Custom {
+    [Storable]
+    public int i;
+    [Storable]
+    public Root r;
+    [Storable]
+    public string name = "<![CDATA[<![CDATA[Serial]]>]]>";
+  }
+
+  [StorableClass("7CF19EBC-1EC4-4FBE-BCA9-DA48E3CFE30D")]
+  public class Manager {
+
+    public DateTime lastLoadTime;
+    [Storable]
+    private DateTime lastLoadTimePersistence {
+      get { return lastLoadTime; }
+      set { lastLoadTime = DateTime.Now; }
+    }
+    [Storable]
+    public double? dbl;
+  }
+
+  [StorableClass("9092C705-F5E9-4BA9-9750-4357DB29AABF")]
+  public class C {
+    [Storable]
+    public C[][] allCs;
+    [Storable]
+    public KeyValuePair<List<C>, C> kvpList;
+  }
+
+  public class NonSerializable {
+    int x = 0;
+    public override bool Equals(object obj) {
+      NonSerializable ns = obj as NonSerializable;
+      if (ns == null)
+        throw new NotSupportedException();
+      return ns.x == x;
+    }
+    public override int GetHashCode() {
+      return x.GetHashCode();
+    }
+  }
+
+  #endregion
+
+  [TestClass]
+  public class UseCasesPersistenceNew {
+    #region Helpers
+    private string tempFile;
+
+    [ClassInitialize]
+    public static void Initialize(TestContext testContext) {
+      ConfigurationService.Instance.Reset();
+    }
+
+    [TestInitialize()]
+    public void CreateTempFile() {
+      tempFile = Path.GetTempFileName();
+    }
+
+    [TestCleanup()]
+    public void ClearTempFile() {
+      StreamReader reader = new StreamReader(tempFile);
+      string s = reader.ReadToEnd();
+      reader.Close();
+      File.Delete(tempFile);
+    }
+    #endregion
+
+    #region Persistence 4.0 test methods
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestBool() {
+      bool test = true;
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      serializer.Serialize(test, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      bool result = (bool)o;
+      Assert.AreEqual(test, result);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestInt() {
+      int test = 42;
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      serializer.Serialize(test, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      int result = (int)o;
+      Assert.AreEqual(test, result);
+    }
+    #endregion
+
+
+    #region Old persistence test methods
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void ComplexStorable() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      Root r = InitializeComplexStorable();
+      serializer.Serialize(r, tempFile);
+      Root newR = (Root)serializer.Deserialize(tempFile);
+      CompareComplexStorables(r, newR);
+    }
+
+    private static void CompareComplexStorables(Root r, Root newR) {
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(r),
+        DebugStringGenerator.Serialize(newR));
+      Assert.AreSame(newR, newR.selfReferences[0]);
+      Assert.AreNotSame(r, newR);
+      Assert.AreEqual(r.myEnum, TestEnum.va1);
+      Assert.AreEqual(r.i[0], 7);
+      Assert.AreEqual(r.i[1], 5);
+      Assert.AreEqual(r.i[2], 6);
+      Assert.AreEqual(r.s, "new value");
+      Assert.AreEqual(r.intArray[0], 3);
+      Assert.AreEqual(r.intArray[1], 2);
+      Assert.AreEqual(r.intArray[2], 1);
+      Assert.AreEqual(r.intList[0], 9);
+      Assert.AreEqual(r.intList[1], 8);
+      Assert.AreEqual(r.intList[2], 7);
+      Assert.AreEqual(r.multiDimArray[0, 0], 5);
+      Assert.AreEqual(r.multiDimArray[0, 1], 4);
+      Assert.AreEqual(r.multiDimArray[0, 2], 3);
+      Assert.AreEqual(r.multiDimArray[1, 0], 1);
+      Assert.AreEqual(r.multiDimArray[1, 1], 4);
+      Assert.AreEqual(r.multiDimArray[1, 2], 6);
+      Assert.IsFalse(r.boolean);
+      Assert.IsTrue((DateTime.Now - r.dateTime).TotalSeconds < 10);
+      Assert.AreEqual(r.kvp.Key, "string key");
+      Assert.AreEqual(r.kvp.Value, 321);
+      Assert.IsNull(r.uninitialized);
+      Assert.AreEqual(newR.myEnum, TestEnum.va1);
+      Assert.AreEqual(newR.i[0], 7);
+      Assert.AreEqual(newR.i[1], 5);
+      Assert.AreEqual(newR.i[2], 6);
+      Assert.AreEqual(newR.s, "new value");
+      Assert.AreEqual(newR.intArray[0], 3);
+      Assert.AreEqual(newR.intArray[1], 2);
+      Assert.AreEqual(newR.intArray[2], 1);
+      Assert.AreEqual(newR.intList[0], 9);
+      Assert.AreEqual(newR.intList[1], 8);
+      Assert.AreEqual(newR.intList[2], 7);
+      Assert.AreEqual(newR.multiDimArray[0, 0], 5);
+      Assert.AreEqual(newR.multiDimArray[0, 1], 4);
+      Assert.AreEqual(newR.multiDimArray[0, 2], 3);
+      Assert.AreEqual(newR.multiDimArray[1, 0], 1);
+      Assert.AreEqual(newR.multiDimArray[1, 1], 4);
+      Assert.AreEqual(newR.multiDimArray[1, 2], 6);
+      Assert.AreEqual(newR.intStack.Pop(), 3);
+      Assert.AreEqual(newR.intStack.Pop(), 2);
+      Assert.AreEqual(newR.intStack.Pop(), 1);
+      Assert.IsFalse(newR.boolean);
+      Assert.IsTrue((DateTime.Now - newR.dateTime).TotalSeconds < 10);
+      Assert.AreEqual(newR.kvp.Key, "string key");
+      Assert.AreEqual(newR.kvp.Value, 321);
+      Assert.IsNull(newR.uninitialized);
+    }
+
+    private static Root InitializeComplexStorable() {
+      Root r = new Root();
+      r.intStack.Push(1);
+      r.intStack.Push(2);
+      r.intStack.Push(3);
+      r.selfReferences = new List<Root> { r, r };
+      r.c = new Custom { r = r };
+      r.dict.Add("one", 1);
+      r.dict.Add("two", 2);
+      r.dict.Add("three", 3);
+      r.myEnum = TestEnum.va1;
+      r.i = new[] { 7, 5, 6 };
+      r.s = "new value";
+      r.intArray = new ArrayList { 3, 2, 1 };
+      r.intList = new List<int> { 9, 8, 7 };
+      r.multiDimArray = new double[,] { { 5, 4, 3 }, { 1, 4, 6 } };
+      r.boolean = false;
+      r.dateTime = DateTime.Now;
+      r.kvp = new KeyValuePair<string, int>("string key", 321);
+      r.uninitialized = null;
+
+      return r;
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void SelfReferences() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      C c = new C();
+      C[][] cs = new C[2][];
+      cs[0] = new C[] { c };
+      cs[1] = new C[] { c };
+      c.allCs = cs;
+      c.kvpList = new KeyValuePair<List<C>, C>(new List<C> { c }, c);
+      serializer.Serialize(cs, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(cs),
+        DebugStringGenerator.Serialize(o));
+      Assert.AreSame(c, c.allCs[0][0]);
+      Assert.AreSame(c, c.allCs[1][0]);
+      Assert.AreSame(c, c.kvpList.Key[0]);
+      Assert.AreSame(c, c.kvpList.Value);
+      C[][] newCs = (C[][])o;
+      C newC = newCs[0][0];
+      Assert.AreSame(newC, newC.allCs[0][0]);
+      Assert.AreSame(newC, newC.allCs[1][0]);
+      Assert.AreSame(newC, newC.kvpList.Key[0]);
+      Assert.AreSame(newC, newC.kvpList.Value);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void ArrayCreation() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      ArrayList[] arrayListArray = new ArrayList[4];
+      arrayListArray[0] = new ArrayList();
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[1] = new ArrayList();
+      arrayListArray[1].Add(arrayListArray);
+      arrayListArray[2] = new ArrayList();
+      arrayListArray[2].Add(arrayListArray);
+      arrayListArray[2].Add(arrayListArray);
+      Array a = Array.CreateInstance(
+                              typeof(object),
+                              new[] { 1, 2 }, new[] { 3, 4 });
+      arrayListArray[2].Add(a);
+      serializer.Serialize(arrayListArray, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(arrayListArray),
+        DebugStringGenerator.Serialize(o));
+      ArrayList[] newArray = (ArrayList[])o;
+      Assert.AreSame(arrayListArray, arrayListArray[0][0]);
+      Assert.AreSame(arrayListArray, arrayListArray[2][1]);
+      Assert.AreSame(newArray, newArray[0][0]);
+      Assert.AreSame(newArray, newArray[2][1]);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void CustomSerializationProperty() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      Manager m = new Manager();
+      serializer.Serialize(m, tempFile);
+      Manager newM = (Manager)serializer.Deserialize(tempFile);
+      Assert.AreNotEqual(
+        DebugStringGenerator.Serialize(m),
+        DebugStringGenerator.Serialize(newM));
+      Assert.AreEqual(m.dbl, newM.dbl);
+      Assert.AreEqual(m.lastLoadTime, new DateTime());
+      Assert.AreNotEqual(newM.lastLoadTime, new DateTime());
+      Assert.IsTrue((DateTime.Now - newM.lastLoadTime).TotalSeconds < 10);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void Primitives() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      PrimitivesTest sdt = new PrimitivesTest();
+      serializer.Serialize(sdt, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(sdt),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void MultiDimensionalArray() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      string[,] mDimString = new string[,] {
+        {"ora", "et", "labora"},
+        {"Beten", "und", "Arbeiten"}
+      };
+      serializer.Serialize(mDimString, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(mDimString),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [StorableClass("87A331AF-14DC-48B3-B577-D49065743BE6")]
+    public class NestedType {
+      [Storable]
+      private string value = "value";
+      public override bool Equals(object obj) {
+        NestedType nt = obj as NestedType;
+        if (nt == null)
+          throw new NotSupportedException();
+        return nt.value == value;
+      }
+      public override int GetHashCode() {
+        return value.GetHashCode();
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void NestedTypeTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      NestedType t = new NestedType();
+      serializer.Serialize(t, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(t),
+        DebugStringGenerator.Serialize(o));
+      Assert.IsTrue(t.Equals(o));
+    }
+
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void SimpleArray() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      string[] strings = { "ora", "et", "labora" };
+      serializer.Serialize(strings, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(strings),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void PrimitiveRoot() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      serializer.Serialize(12.3f, tempFile);
+      object o = serializer.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(12.3f),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    private string formatFullMemberName(MemberInfo mi) {
+      return new StringBuilder()
+        .Append(mi.DeclaringType.Assembly.GetName().Name)
+        .Append(": ")
+        .Append(mi.DeclaringType.Namespace)
+        .Append('.')
+        .Append(mi.DeclaringType.Name)
+        .Append('.')
+        .Append(mi.Name).ToString();
+    }
+
+    public void CodingConventions() {
+      List<string> lowerCaseMethodNames = new List<string>();
+      List<string> lowerCaseProperties = new List<string>();
+      List<string> lowerCaseFields = new List<string>();
+      foreach (Assembly a in PluginLoader.Assemblies) {
+        if (!a.GetName().Name.StartsWith("HeuristicLab"))
+          continue;
+        foreach (Type t in a.GetTypes()) {
+          foreach (MemberInfo mi in t.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)) {
+            if (mi.DeclaringType.Name.StartsWith("<>"))
+              continue;
+            if (char.IsLower(mi.Name[0])) {
+              if (mi.MemberType == MemberTypes.Field)
+                lowerCaseFields.Add(formatFullMemberName(mi));
+              if (mi.MemberType == MemberTypes.Property)
+                lowerCaseProperties.Add(formatFullMemberName(mi));
+              if (mi.MemberType == MemberTypes.Method &&
+                !mi.Name.StartsWith("get_") &&
+                !mi.Name.StartsWith("set_") &&
+                !mi.Name.StartsWith("add_") &&
+                !mi.Name.StartsWith("remove_") &&
+                !mi.Name.StartsWith("op_"))
+                lowerCaseMethodNames.Add(formatFullMemberName(mi));
+            }
+          }
+        }
+      }
+      //Assert.AreEqual("", lowerCaseFields.Aggregate("", (a, b) => a + "\r\n" + b));
+      Assert.AreEqual("", lowerCaseMethodNames.Aggregate("", (a, b) => a + "\r\n" + b));
+      Assert.AreEqual("", lowerCaseProperties.Aggregate("", (a, b) => a + "\r\n" + b));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void Enums() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      EnumTest et = new EnumTest();
+      et.simpleEnum = SimpleEnum.two;
+      et.complexEnum = ComplexEnum.three;
+      et.trickyEnum = TrickyEnum.two | TrickyEnum.one;
+      serializer.Serialize(et, tempFile);
+      EnumTest newEt = (EnumTest)serializer.Deserialize(tempFile);
+      Assert.AreEqual(et.simpleEnum, SimpleEnum.two);
+      Assert.AreEqual(et.complexEnum, ComplexEnum.three);
+      Assert.AreEqual(et.trickyEnum, (TrickyEnum)3);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestAliasingWithOverriddenEquals() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      List<IntWrapper> ints = new List<IntWrapper>();
+      ints.Add(new IntWrapper(1));
+      ints.Add(new IntWrapper(1));
+      Assert.AreEqual(ints[0], ints[1]);
+      Assert.AreNotSame(ints[0], ints[1]);
+      serializer.Serialize(ints, tempFile);
+      List<IntWrapper> newInts = (List<IntWrapper>)serializer.Deserialize(tempFile);
+      Assert.AreEqual(newInts[0].Value, 1);
+      Assert.AreEqual(newInts[1].Value, 1);
+      Assert.AreEqual(newInts[0], newInts[1]);
+      Assert.AreNotSame(newInts[0], newInts[1]);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void NonDefaultConstructorTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      NonDefaultConstructorClass c = new NonDefaultConstructorClass(1);
+      try {
+        serializer.Serialize(c, tempFile);
+        Assert.Fail("Exception not thrown");
+      }
+      catch (PersistenceException) {
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestSavingException() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      List<int> list = new List<int> { 1, 2, 3 };
+      serializer.Serialize(list, tempFile);
+      NonSerializable s = new NonSerializable();
+      try {
+        serializer.Serialize(s, tempFile);
+        Assert.Fail("Exception expected");
+      }
+      catch (PersistenceException) { }
+      List<int> newList = (List<int>)serializer.Deserialize(tempFile);
+      Assert.AreEqual(list[0], newList[0]);
+      Assert.AreEqual(list[1], newList[1]);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestTypeStringConversion() {
+      string name = typeof(List<int>[]).AssemblyQualifiedName;
+      string shortName =
+        "System.Collections.Generic.List`1[[System.Int32, mscorlib]][], mscorlib";
+      Assert.AreEqual(name, TypeNameParser.Parse(name).ToString());
+      Assert.AreEqual(shortName, TypeNameParser.Parse(name).ToString(false));
+      Assert.AreEqual(shortName, typeof(List<int>[]).VersionInvariantName());
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestHexadecimalPublicKeyToken() {
+      string name = "TestClass, TestAssembly, Version=1.2.3.4, PublicKey=1234abc";
+      string shortName = "TestClass, TestAssembly";
+      Assert.AreEqual(name, TypeNameParser.Parse(name).ToString());
+      Assert.AreEqual(shortName, TypeNameParser.Parse(name).ToString(false));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void InheritanceTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      New n = new New();
+      serializer.Serialize(n, tempFile);
+      New nn = (New)serializer.Deserialize(tempFile);
+      Assert.AreEqual(n.Name, nn.Name);
+      Assert.AreEqual(((Override)n).Name, ((Override)nn).Name);
+    }
+
+    [StorableClass("B963EF51-12B4-432E-8C54-88F026F9ACE2")]
+    class Child {
+      [Storable]
+      public GrandParent grandParent;
+    }
+
+    [StorableClass("E66E9606-967A-4C35-A361-F6F0D21C064A")]
+    class Parent {
+      [Storable]
+      public Child child;
+    }
+
+    [StorableClass("34D3893A-57AD-4F72-878B-81D6FA3F14A9")]
+    class GrandParent {
+      [Storable]
+      public Parent parent;
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void InstantiateParentChainReference() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      GrandParent gp = new GrandParent();
+      gp.parent = new Parent();
+      gp.parent.child = new Child();
+      gp.parent.child.grandParent = gp;
+      Assert.AreSame(gp, gp.parent.child.grandParent);
+      serializer.Serialize(gp, tempFile);
+      GrandParent newGp = (GrandParent)serializer.Deserialize(tempFile);
+      Assert.AreSame(newGp, newGp.parent.child.grandParent);
+    }
+
+    struct TestStruct {
+      int value;
+      int PropertyValue { get; set; }
+      public TestStruct(int value)
+        : this() {
+        this.value = value;
+        PropertyValue = value;
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void StructTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      TestStruct s = new TestStruct(10);
+      serializer.Serialize(s, tempFile);
+      TestStruct newS = (TestStruct)serializer.Deserialize(tempFile);
+      Assert.AreEqual(s, newS);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void PointTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      Point p = new Point(12, 34);
+      serializer.Serialize(p, tempFile);
+      Point newP = (Point)serializer.Deserialize(tempFile);
+      Assert.AreEqual(p, newP);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void NullableValueTypes() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      double?[] d = new double?[] { null, 1, 2, 3 };
+      serializer.Serialize(d, tempFile);
+      double?[] newD = (double?[])serializer.Deserialize(tempFile);
+      Assert.AreEqual(d[0], newD[0]);
+      Assert.AreEqual(d[1], newD[1]);
+      Assert.AreEqual(d[2], newD[2]);
+      Assert.AreEqual(d[3], newD[3]);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void BitmapTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      Icon icon = System.Drawing.SystemIcons.Hand;
+      Bitmap bitmap = icon.ToBitmap();
+      serializer.Serialize(bitmap, tempFile);
+      Bitmap newBitmap = (Bitmap)serializer.Deserialize(tempFile);
+
+      Assert.AreEqual(bitmap.Size, newBitmap.Size);
+      for (int i = 0; i < bitmap.Size.Width; i++)
+        for (int j = 0; j < bitmap.Size.Height; j++)
+          Assert.AreEqual(bitmap.GetPixel(i, j), newBitmap.GetPixel(i, j));
+    }
+
+    [StorableClass("E846BC49-20F3-4D3F-A3F3-73D4F2DB1C2E")]
+    private class PersistenceHooks {
+      [Storable]
+      public int a;
+      [Storable]
+      public int b;
+      public int sum;
+      public bool WasSerialized { get; private set; }
+      [StorableHook(HookType.BeforeSerialization)]
+      void PreSerializationHook() {
+        WasSerialized = true;
+      }
+      [StorableHook(HookType.AfterDeserialization)]
+      void PostDeserializationHook() {
+        sum = a + b;
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void HookTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      PersistenceHooks hookTest = new PersistenceHooks();
+      hookTest.a = 2;
+      hookTest.b = 5;
+      Assert.IsFalse(hookTest.WasSerialized);
+      Assert.AreEqual(hookTest.sum, 0);
+      serializer.Serialize(hookTest, tempFile);
+      Assert.IsTrue(hookTest.WasSerialized);
+      Assert.AreEqual(hookTest.sum, 0);
+      PersistenceHooks newHookTest = (PersistenceHooks)serializer.Deserialize(tempFile);
+      Assert.AreEqual(newHookTest.a, hookTest.a);
+      Assert.AreEqual(newHookTest.b, hookTest.b);
+      Assert.AreEqual(newHookTest.sum, newHookTest.a + newHookTest.b);
+      Assert.IsFalse(newHookTest.WasSerialized);
+    }
+
+    [StorableClass("A35D71DF-397F-4910-A950-ED6923BE9483")]
+    private class CustomConstructor {
+      public string Value = "none";
+      public CustomConstructor() {
+        Value = "default";
+      }
+      [StorableConstructor]
+      private CustomConstructor(bool deserializing) {
+        Assert.IsTrue(deserializing);
+        Value = "persistence";
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestCustomConstructor() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      CustomConstructor cc = new CustomConstructor();
+      Assert.AreEqual(cc.Value, "default");
+      serializer.Serialize(cc, tempFile);
+      CustomConstructor newCC = (CustomConstructor)serializer.Deserialize(tempFile);
+      Assert.AreEqual(newCC.Value, "persistence");
+    }
+
+    [StorableClass("D276E825-1F35-4BAC-8937-9ABC91D5C316")]
+    public class ExplodingDefaultConstructor {
+      public ExplodingDefaultConstructor() {
+        throw new Exception("this constructor will always fail");
+      }
+      public ExplodingDefaultConstructor(string password) {
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestConstructorExceptionUnwrapping() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      ExplodingDefaultConstructor x = new ExplodingDefaultConstructor("password");
+      serializer.Serialize(x, tempFile);
+      try {
+        ExplodingDefaultConstructor newX = (ExplodingDefaultConstructor)serializer.Deserialize(tempFile);
+        Assert.Fail("Exception expected");
+      }
+      catch (PersistenceException pe) {
+        Assert.AreEqual(pe.InnerException.Message, "this constructor will always fail");
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestRejectionJustifications() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      NonSerializable ns = new NonSerializable();
+      try {
+        serializer.Serialize(ns, tempFile);
+        Assert.Fail("PersistenceException expected");
+      }
+      catch (PersistenceException x) {
+        Assert.IsTrue(x.Message.Contains(new StorableSerializer().JustifyRejection(typeof(NonSerializable))));
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStreaming() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      using (MemoryStream stream = new MemoryStream()) {
+        Root r = InitializeComplexStorable();
+        serializer.Serialize(r, stream);
+        using (MemoryStream stream2 = new MemoryStream(stream.ToArray())) {
+          Root newR = (Root)serializer.Deserialize(stream2);
+          CompareComplexStorables(r, newR);
+        }
+      }
+    }
+
+    [StorableClass("4921031B-CB61-4677-97AD-9236A4CEC200")]
+    public class HookInheritanceTestBase {
+      [Storable]
+      public object a;
+      public object link;
+      [StorableHook(HookType.AfterDeserialization)]
+      private void relink() {
+        link = a;
+      }
+    }
+
+    [StorableClass("321CEE0A-5201-4CE2-B135-2343890D96BF")]
+    public class HookInheritanceTestDerivedClass : HookInheritanceTestBase {
+      [Storable]
+      public object b;
+      [StorableHook(HookType.AfterDeserialization)]
+      private void relink() {
+        Assert.AreSame(a, link);
+        link = b;
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestLinkInheritance() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      HookInheritanceTestDerivedClass c = new HookInheritanceTestDerivedClass();
+      c.a = new object();
+      serializer.Serialize(c, tempFile);
+      HookInheritanceTestDerivedClass newC = (HookInheritanceTestDerivedClass)serializer.Deserialize(tempFile);
+      Assert.AreSame(c.b, c.link);
+    }
+
+    [StorableClass(StorableClassType.AllFields, "B9AB42E8-1932-425B-B4CF-F31F07EAC599")]
+    public class AllFieldsStorable {
+      public int Value1 = 1;
+      [Storable]
+      public int Value2 = 2;
+      public int Value3 { get; private set; }
+      public int Value4 { get; private set; }
+      [StorableConstructor]
+      public AllFieldsStorable(bool isDeserializing) {
+        if (!isDeserializing) {
+          Value1 = 12;
+          Value2 = 23;
+          Value3 = 34;
+          Value4 = 56;
+        }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStorableClassDiscoveryAllFields() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      AllFieldsStorable afs = new AllFieldsStorable(false);
+      serializer.Serialize(afs, tempFile);
+      AllFieldsStorable newAfs = (AllFieldsStorable)serializer.Deserialize(tempFile);
+      Assert.AreEqual(afs.Value1, newAfs.Value1);
+      Assert.AreEqual(afs.Value2, newAfs.Value2);
+      Assert.AreEqual(0, newAfs.Value3);
+      Assert.AreEqual(0, newAfs.Value4);
+    }
+
+    [StorableClass(StorableClassType.AllProperties, "CB7DC31C-AEF3-4EB8-91CA-248B767E9F92")]
+    public class AllPropertiesStorable {
+      public int Value1 = 1;
+      [Storable]
+      public int Value2 = 2;
+      public int Value3 { get; private set; }
+      public int Value4 { get; private set; }
+      [StorableConstructor]
+      public AllPropertiesStorable(bool isDeserializing) {
+        if (!isDeserializing) {
+          Value1 = 12;
+          Value2 = 23;
+          Value3 = 34;
+          Value4 = 56;
+        }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStorableClassDiscoveryAllProperties() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      AllPropertiesStorable afs = new AllPropertiesStorable(false);
+      serializer.Serialize(afs, tempFile);
+      AllPropertiesStorable newAfs = (AllPropertiesStorable)serializer.Deserialize(tempFile);
+      Assert.AreEqual(1, newAfs.Value1);
+      Assert.AreEqual(2, newAfs.Value2);
+      Assert.AreEqual(afs.Value3, newAfs.Value3);
+      Assert.AreEqual(afs.Value4, newAfs.Value4);
+
+    }
+
+    [StorableClass(StorableClassType.AllFieldsAndAllProperties, "0AD8D68F-E0FF-4FA8-8A72-1148CD91A2B9")]
+    public class AllFieldsAndAllPropertiesStorable {
+      public int Value1 = 1;
+      [Storable]
+      public int Value2 = 2;
+      public int Value3 { get; private set; }
+      public int Value4 { get; private set; }
+      [StorableConstructor]
+      public AllFieldsAndAllPropertiesStorable(bool isDeserializing) {
+        if (!isDeserializing) {
+          Value1 = 12;
+          Value2 = 23;
+          Value3 = 34;
+          Value4 = 56;
+        }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStorableClassDiscoveryAllFieldsAndAllProperties() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      AllFieldsAndAllPropertiesStorable afs = new AllFieldsAndAllPropertiesStorable(false);
+      serializer.Serialize(afs, tempFile);
+      AllFieldsAndAllPropertiesStorable newAfs = (AllFieldsAndAllPropertiesStorable)serializer.Deserialize(tempFile);
+      Assert.AreEqual(afs.Value1, newAfs.Value1);
+      Assert.AreEqual(afs.Value2, newAfs.Value2);
+      Assert.AreEqual(afs.Value3, newAfs.Value3);
+      Assert.AreEqual(afs.Value4, newAfs.Value4);
+    }
+
+    [StorableClass(StorableClassType.MarkedOnly, "0D94E6D4-64E3-4637-B1EE-DEF2B3F6E2E0")]
+    public class MarkedOnlyStorable {
+      public int Value1 = 1;
+      [Storable]
+      public int Value2 = 2;
+      public int Value3 { get; private set; }
+      public int Value4 { get; private set; }
+      [StorableConstructor]
+      public MarkedOnlyStorable(bool isDeserializing) {
+        if (!isDeserializing) {
+          Value1 = 12;
+          Value2 = 23;
+          Value3 = 34;
+          Value4 = 56;
+        }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStorableClassDiscoveryMarkedOnly() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      MarkedOnlyStorable afs = new MarkedOnlyStorable(false);
+      serializer.Serialize(afs, tempFile);
+      MarkedOnlyStorable newAfs = (MarkedOnlyStorable)serializer.Deserialize(tempFile);
+      Assert.AreEqual(1, newAfs.Value1);
+      Assert.AreEqual(afs.Value2, newAfs.Value2);
+      Assert.AreEqual(0, newAfs.Value3);
+      Assert.AreEqual(0, newAfs.Value4);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestLineEndings() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      List<string> lineBreaks = new List<string> { "\r\n", "\n", "\r", "\n\r", Environment.NewLine };
+      List<string> lines = new List<string>();
+      foreach (var br in lineBreaks)
+        lines.Add("line1" + br + "line2");
+      serializer.Serialize(lines, tempFile);
+      List<string> newLines = (List<string>)serializer.Deserialize(tempFile);
+      Assert.AreEqual(lines.Count, newLines.Count);
+      for (int i = 0; i < lineBreaks.Count; i++) {
+        Assert.AreEqual(lines[i], newLines[i]);
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestSpecialNumbers() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      List<double> specials = new List<double>() { 1.0 / 0, -1.0 / 0, 0.0 / 0 };
+      Assert.IsTrue(double.IsPositiveInfinity(specials[0]));
+      Assert.IsTrue(double.IsNegativeInfinity(specials[1]));
+      Assert.IsTrue(double.IsNaN(specials[2]));
+      serializer.Serialize(specials, tempFile);
+      List<double> newSpecials = (List<double>)serializer.Deserialize(tempFile);
+      Assert.IsTrue(double.IsPositiveInfinity(newSpecials[0]));
+      Assert.IsTrue(double.IsNegativeInfinity(newSpecials[1]));
+      Assert.IsTrue(double.IsNaN(newSpecials[2]));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStringSplit() {
+      string s = "1.2;2.3;3.4;;;4.9";
+      var l = s.EnumerateSplit(';').ToList();
+      Assert.AreEqual("1.2", l[0]);
+      Assert.AreEqual("2.3", l[1]);
+      Assert.AreEqual("3.4", l[2]);
+      Assert.AreEqual("4.9", l[3]);
+    }
+
+    private class IdentityComparer<T> : IEqualityComparer<T> {
+
+      public bool Equals(T x, T y) {
+        return x.Equals(y);
+      }
+
+      public int GetHashCode(T obj) {
+        return obj.GetHashCode();
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestHashSetSerializer() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var hashSets = new List<HashSet<int>>() {
+        new HashSet<int>(new[] { 1, 2, 3 }),
+        new HashSet<int>(new[] { 4, 5, 6 }, new IdentityComparer<int>()),
+      };
+      serializer.Serialize(hashSets, tempFile);
+      var newHashSets = (List<HashSet<int>>)serializer.Deserialize(tempFile);
+      Assert.IsTrue(newHashSets[0].Contains(1));
+      Assert.IsTrue(newHashSets[0].Contains(2));
+      Assert.IsTrue(newHashSets[0].Contains(3));
+      Assert.IsTrue(newHashSets[1].Contains(4));
+      Assert.IsTrue(newHashSets[1].Contains(5));
+      Assert.IsTrue(newHashSets[1].Contains(6));
+      Assert.AreEqual(newHashSets[0].Comparer.GetType(), new HashSet<int>().Comparer.GetType());
+      Assert.AreEqual(newHashSets[1].Comparer.GetType(), typeof(IdentityComparer<int>));
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestConcreteDictionarySerializer() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var dictionaries = new List<Dictionary<int, int>>() {
+        new Dictionary<int, int>(),
+        new Dictionary<int, int>(new IdentityComparer<int>()),
+      };
+      dictionaries[0].Add(1, 1);
+      dictionaries[0].Add(2, 2);
+      dictionaries[0].Add(3, 3);
+      dictionaries[1].Add(4, 4);
+      dictionaries[1].Add(5, 5);
+      dictionaries[1].Add(6, 6);
+      serializer.Serialize(dictionaries, tempFile);
+      var newDictionaries = (List<Dictionary<int, int>>)serializer.Deserialize(tempFile);
+      Assert.IsTrue(newDictionaries[0].ContainsKey(1));
+      Assert.IsTrue(newDictionaries[0].ContainsKey(2));
+      Assert.IsTrue(newDictionaries[0].ContainsKey(3));
+      Assert.IsTrue(newDictionaries[1].ContainsKey(4));
+      Assert.IsTrue(newDictionaries[1].ContainsKey(5));
+      Assert.IsTrue(newDictionaries[1].ContainsKey(6));
+      Assert.IsTrue(newDictionaries[0].ContainsValue(1));
+      Assert.IsTrue(newDictionaries[0].ContainsValue(2));
+      Assert.IsTrue(newDictionaries[0].ContainsValue(3));
+      Assert.IsTrue(newDictionaries[1].ContainsValue(4));
+      Assert.IsTrue(newDictionaries[1].ContainsValue(5));
+      Assert.IsTrue(newDictionaries[1].ContainsValue(6));
+      Assert.AreEqual(new Dictionary<int, int>().Comparer.GetType(), newDictionaries[0].Comparer.GetType());
+      Assert.AreEqual(typeof(IdentityComparer<int>), newDictionaries[1].Comparer.GetType());
+    }
+
+    [StorableClass("A9B0D7FB-0CAF-4DD7-9045-EA136F9176F7")]
+    public class ReadOnlyFail {
+      [Storable]
+      public string ReadOnly {
+        get { return "fail"; }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestReadOnlyFail() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      try {
+        serializer.Serialize(new ReadOnlyFail(), tempFile);
+        Assert.Fail("Exception expected");
+      }
+      catch (PersistenceException) {
+      }
+      catch {
+        Assert.Fail("PersistenceException expected");
+      }
+    }
+
+
+    [StorableClass("2C9CC576-6823-4784-817B-37C8AF0B1C29")]
+    public class WriteOnlyFail {
+      [Storable]
+      public string WriteOnly {
+        set { throw new InvalidOperationException("this property should never be set."); }
+      }
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestWriteOnlyFail() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      try {
+        serializer.Serialize(new WriteOnlyFail(), tempFile);
+        Assert.Fail("Exception expected");
+      }
+      catch (PersistenceException) {
+      }
+      catch {
+        Assert.Fail("PersistenceException expected.");
+      }
+    }
+
+    [StorableClass("8052D9E3-6DDD-4AE1-9B5B-67C6D5436512")]
+    public class OneWayTest {
+      public OneWayTest() { this.value = "default"; }
+      public string value;
+      [Storable(AllowOneWay = true)]
+      public string ReadOnly {
+        get { return "ReadOnly"; }
+      }
+      [Storable(AllowOneWay = true)]
+      public string WriteOnly {
+        set { this.value = value; }
+      }
+    }
+
+    //TODO
+    /* [TestMethod]
+     [TestCategory("Persistence")]
+     [TestProperty("Time", "short")]
+     public void TestTypeCacheExport() {
+       ProtoBufSerializer serializer = new ProtoBufSerializer();
+       var test = new List<List<int>>();
+       test.Add(new List<int>() { 1, 2, 3 });
+       IEnumerable<Type> types;
+       using (var stream = new MemoryStream()) {
+         XmlGenerator.Serialize(test, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, out types);
+       }
+       List<Type> t = new List<Type>(types);
+       // Assert.IsTrue(t.Contains(typeof(int))); not serialized as an int list is directly transformed into a string
+       Assert.IsTrue(t.Contains(typeof(List<int>)));
+       Assert.IsTrue(t.Contains(typeof(List<List<int>>)));
+       Assert.AreEqual(t.Count, 2);
+     }*/
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TupleTest() {
+      var t1 = Tuple.Create(1);
+      var t2 = Tuple.Create('1', "2");
+      var t3 = Tuple.Create(3.0, 3f, 5);
+      var t4 = Tuple.Create(Tuple.Create(1, 2, 3), Tuple.Create(4, 5, 6), Tuple.Create(8, 9, 10));
+      var tuple = Tuple.Create(t1, t2, t3, t4);
+      XmlGenerator.Serialize(tuple, tempFile);
+      var newTuple = XmlParser.Deserialize<Tuple<Tuple<int>, Tuple<char, string>, Tuple<double, float, int>, Tuple<Tuple<int, int, int>, Tuple<int, int, int>, Tuple<int, int, int>>>>(tempFile);
+      Assert.AreEqual(tuple, newTuple);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void FontTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      List<Font> fonts = new List<Font>() {
+        new Font(FontFamily.GenericSansSerif, 12),
+        new Font("Times New Roman", 21, FontStyle.Bold, GraphicsUnit.Pixel),
+        new Font("Courier New", 10, FontStyle.Underline, GraphicsUnit.Document),
+        new Font("Helvetica", 21, FontStyle.Strikeout, GraphicsUnit.Inch, 0, true),
+      };
+      serializer.Serialize(fonts, tempFile);
+      var newFonts = (List<Font>)serializer.Deserialize(tempFile);
+      Assert.AreEqual(fonts[0], newFonts[0]);
+      Assert.AreEqual(fonts[1], newFonts[1]);
+      Assert.AreEqual(fonts[2], newFonts[2]);
+      Assert.AreEqual(fonts[3], newFonts[3]);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "medium")]
+    public void ConcurrencyTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      int n = 20;
+      Task[] tasks = new Task[n];
+      for (int i = 0; i < n; i++) {
+        tasks[i] = Task.Factory.StartNew((idx) => {
+          byte[] data;
+          using (var stream = new MemoryStream()) {
+            serializer.Serialize(new GeneticAlgorithm(), stream);
+            data = stream.ToArray();
+          }
+        }, i);
+      }
+      Task.WaitAll(tasks);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "medium")]
+    public void ConcurrentBitmapTest() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      Bitmap b = new Bitmap(300, 300);
+      System.Random r = new System.Random();
+      for (int x = 0; x < b.Height; x++) {
+        for (int y = 0; y < b.Width; y++) {
+          b.SetPixel(x, y, Color.FromArgb(r.Next()));
+        }
+      }
+      Task[] tasks = new Task[20];
+      byte[][] datas = new byte[tasks.Length][];
+      for (int i = 0; i < tasks.Length; i++) {
+        tasks[i] = Task.Factory.StartNew((idx) => {
+          using (var stream = new MemoryStream()) {
+            serializer.Serialize(b, stream);
+            datas[(int)idx] = stream.ToArray();
+          }
+        }, i);
+      }
+      Task.WaitAll(tasks);
+    }
+
+    public class G<T, T2> {
+      public class S { }
+      public class S2<T3, T4> { }
+    }
+
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestSpecialCharacters() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var s = "abc" + "\x15" + "def";
+      serializer.Serialize(s, tempFile);
+      var newS = serializer.Deserialize(tempFile);
+      Assert.AreEqual(s, newS);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestByteArray() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var b = new byte[3];
+      b[0] = 0;
+      b[1] = 200;
+      b[2] = byte.MaxValue;
+      serializer.Serialize(b, tempFile);
+      var newB = (byte[])serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(b, newB);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestOptionalNumberEnumerable() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var values = new List<double?> { 0, null, double.NaN, double.PositiveInfinity, double.MaxValue, 1 };
+      serializer.Serialize(values, tempFile);
+      var newValues = (List<double?>)serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(values, newValues);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestOptionalDateTimeEnumerable() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var values = new List<DateTime?> { DateTime.MinValue, null, DateTime.Now, DateTime.Now.Add(TimeSpan.FromDays(1)),
+        DateTime.ParseExact("10.09.2014 12:21", "dd.MM.yyyy hh:mm", CultureInfo.InvariantCulture), DateTime.MaxValue};
+      serializer.Serialize(values, tempFile);
+      var newValues = (List<DateTime?>)serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(values, newValues);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestStringEnumerable() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var values = new List<string> { "", null, "s", "string", string.Empty, "123", "<![CDATA[nice]]>", "<![CDATA[nasty unterminated" };
+      serializer.Serialize(values, tempFile);
+      var newValues = (List<String>)serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(values, newValues);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestUnicodeCharArray() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var s = Encoding.UTF8.GetChars(new byte[] { 0, 1, 2, 03, 04, 05, 06, 07, 08, 09, 0xa, 0xb });
+      serializer.Serialize(s, tempFile);
+      var newS = (char[])serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(s, newS);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestUnicode() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var s = Encoding.UTF8.GetString(new byte[] { 0, 1, 2, 03, 04, 05, 06, 07, 08, 09, 0xa, 0xb });
+      serializer.Serialize(s, tempFile);
+      var newS = serializer.Deserialize(tempFile);
+      Assert.AreEqual(s, newS);
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence")]
+    [TestProperty("Time", "short")]
+    public void TestQueue() {
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var q = new Queue<int>(new[] { 1, 2, 3, 4, 0 });
+      serializer.Serialize(q, tempFile);
+      var newQ = (Queue<int>)serializer.Deserialize(tempFile);
+      CollectionAssert.AreEqual(q, newQ);
+    }
+    #endregion
+  }
+}
Index: /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Tests.csproj
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 13385)
+++ /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 13386)
@@ -257,4 +257,8 @@
       <HintPath>..\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
       <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\HeuristicLab.Persistence-4.0.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
@@ -552,4 +556,5 @@
     <Compile Include="HeuristicLab.Persistence-3.3\StorableAttributeTests.cs" />
     <Compile Include="HeuristicLab.Persistence-3.3\UseCases.cs" />
+    <Compile Include="HeuristicLab.Persistence-3.3\UseCasesPersistenceNew.cs" />
     <Compile Include="HeuristicLab.PluginInfraStructure-3.3\InstallationManagerTest.cs" />
     <Compile Include="HeuristicLab.PluginInfraStructure-3.3\TypeExtensionsTest.cs" />
