Index: /branches/New Persistence Exploration/Persistence/Persistence/Decomposers.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Decomposers.cs	(revision 1353)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Decomposers.cs	(revision 1354)
@@ -5,39 +5,48 @@
 namespace Persistence {
   
+
   public interface IDecomposer {
     bool CanSerialize(Type type);
-    IEnumerable Serialize(object o);
-    object DeSerialize(IEnumerable o, Type t);
+    IEnumerable Serialize(object obj);
+    object DeSerialize(IEnumerable objects, Type type);
   }
 
+
   public class EnumerableDecomposer : IDecomposer {
+
     public bool CanSerialize(Type type) {
-      if (type.GetInterface("IEnumerable") == null)
-        return false;
-      if (type.GetMethod("GetEnumerator", new Type[] { }) == null)
-        return false;
+      return
+        type.GetInterface("IEnumerable") != null &&
+        type.GetMethod("Add") != null &&
+        type.GetMethod("Add").GetParameters().Length == 1 &&
+        type.GetConstructor(
+          BindingFlags.Public |
+          BindingFlags.NonPublic |
+          BindingFlags.Instance,
+          null, Type.EmptyTypes, null) != null;        
+    }    
+
+    public IEnumerable Serialize(object obj) {
+      return (IEnumerable)obj;
+    }
+
+    public object DeSerialize(IEnumerable objects, Type type) {
+      object instance = Activator.CreateInstance(type, true);
       MethodInfo addMethod = type.GetMethod("Add");
-      if (addMethod == null)
-        return false;
-      if (addMethod.GetParameters().Length != 1)
-        return false;
-      return true;
-    }
-    public IEnumerable Serialize(object o) {
-      return (IEnumerable)o;
-    }
-    public object DeSerialize(IEnumerable objects, Type t) {
-      object instance = Activator.CreateInstance(t, true);
       foreach (object o in objects) {
-        t.GetMethod("Add").Invoke(instance, new[] { o });
+        addMethod.Invoke(instance, new[] {o});        
       }
       return instance;
     }
+
   }
 
+
   public class ArrayDecomposer : IDecomposer {
+
     public bool CanSerialize(Type type) {
       return type.IsArray || type == typeof(Array);
     }
+
     public IEnumerable Serialize(object array) {
       Array a = (Array)array;
@@ -50,4 +59,5 @@
       }
     }
+
     public object DeSerialize(IEnumerable elements, Type t) {
       IEnumerator e = elements.GetEnumerator();
@@ -77,9 +87,13 @@
   }
 
+
   public class KeyValuePairDecomposer : IDecomposer {    
-    public bool CanSerialize(Type type) {      
+
+    public bool CanSerialize(Type type) {
       return type.IsGenericType &&
-        type.GetGenericTypeDefinition().Name == "KeyValuePair`2";
+             type.GetGenericTypeDefinition() == 
+             typeof (KeyValuePair<int, int>).GetGenericTypeDefinition();
     }
+
     public IEnumerable Serialize(object o) {      
       Type t = o.GetType();
@@ -87,4 +101,5 @@
       yield return t.GetProperty("Value").GetValue(o, null);
     }
+
     public object DeSerialize(IEnumerable o, Type t) {      
       return Activator.CreateInstance(t,
@@ -92,4 +107,5 @@
     }    
   }
+
 
   public class DictionaryDecomposer : IDecomposer {
Index: /branches/New Persistence Exploration/Persistence/Persistence/Persistence.csproj
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Persistence.csproj	(revision 1353)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Persistence.csproj	(revision 1354)
@@ -21,5 +21,5 @@
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
Index: /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1353)
+++ /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1354)
@@ -1,7 +1,5 @@
 ﻿using System;
 using System.Collections.Generic;
-using System.Collections;
 using System.IO;
-using System.Reflection;
 
 namespace Persistence.Test {
@@ -120,6 +118,7 @@
     }
 
+
     public static void Main() {      
-      Test1();
+      //Test1();      
       //Test2();
       //SpeedTest();
Index: /branches/New Persistence Exploration/Persistence/Test/Test.csproj
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/Test.csproj	(revision 1353)
+++ /branches/New Persistence Exploration/Persistence/Test/Test.csproj	(revision 1354)
@@ -20,5 +20,5 @@
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
