Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj	(revision 10090)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj	(revision 10104)
@@ -48,4 +48,9 @@
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
     <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -86,4 +91,5 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ConvexHullTest.cs" />
+    <Compile Include="RealVectorSolutionCacheTest.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs	(revision 10090)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs	(revision 10104)
@@ -34,41 +34,43 @@
       PermutationEqualityComparer comp = new PermutationEqualityComparer();
       PermutationSolutionCache dict = new PermutationSolutionCache();
-      int realDuplicates = 0;
-      int noDuplicates = 0;
+      int nrOfPermutations = 200;
 
-      Permutation[] permutations = new Permutation[500];
-      for (int i = 0; i < permutations.Length; i += 2) {
+
+      for (int i = 0; i < nrOfPermutations; i++) {
         var p = new Permutation(PermutationTypes.RelativeUndirected, 21, rand);
-        permutations[i] = p;
-        permutations[i + 1] = p;
 
+        //should be added
         PermutationSolutionInformation pi = new PermutationSolutionInformation();
-        pi.Generation = rand.Next(0, 100);
+        pi.Generation = 9;
         pi.ProducedBy = ProducedBy.Mutation;
+        dict.Add(p, pi);
 
+        //should be added
+        pi = new PermutationSolutionInformation();
+        pi.Generation = 10;
+        pi.ProducedBy = ProducedBy.Mutation;
+        dict.Add(p, pi);
+
+        //should be added
+        pi = new PermutationSolutionInformation();
+        pi.Generation = 10;
+        pi.ProducedBy = ProducedBy.Crossover;
+        dict.Add(p, pi);
+
+        //should not be added
+        pi = new PermutationSolutionInformation();
+        pi.Generation = 10;
+        pi.ProducedBy = ProducedBy.Mutation;
         dict.Add(p, pi);
       }
 
-      for (int i = 0; i < permutations.Length; i++) {
-        for (int j = i + 1; j < permutations.Length; j++) {
-          if (comp.Equals(permutations[i], permutations[j])) {
-            realDuplicates++;
-            break;
-          }
-        }
+      foreach (var value in dict.Values()) {
+        Assert.AreEqual(3, value.Count);
       }
 
-      for (int i = 0; i < dict.SolutionDictionary.Keys.Count; i++) {
-        for (int j = i + 1; j < dict.SolutionDictionary.Keys.Count; j++) {
-          if (comp.Equals(dict.SolutionDictionary.Keys.ElementAt(i), dict.SolutionDictionary.Keys.ElementAt(j))) {
-            noDuplicates++;
-            break;
-          }
-        }
+      foreach (var key in dict.Keys()) {
+        int cnt = dict.Keys().Count(x => comp.Equals(key, x));
+        Assert.AreEqual(1, cnt);
       }
-
-      Assert.AreNotEqual(0, realDuplicates);
-      Assert.AreEqual(0, noDuplicates);
-      Assert.AreEqual(250, dict.SolutionDictionary.Keys.Count);
     }
   }
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/RealVectorSolutionCacheTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/RealVectorSolutionCacheTest.cs	(revision 10104)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/RealVectorSolutionCacheTest.cs	(revision 10104)
@@ -0,0 +1,75 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Linq;
+using HeuristicLab.Analysis.SolutionCaching;
+using HeuristicLab.Analysis.SolutionCaching.RealVectorEncoding;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace AlgorithmBehaviorUnitTests {
+  [TestClass]
+  public class RealVectorSolutionCacheTest {
+    [TestMethod]
+    public void TestCache() {
+      var rand = new HeuristicLab.Random.FastRandom();
+      int nrOfVectors = 200;
+      int vectorLength = 50;
+
+      RealVectorSolutionCache solutionCache = new RealVectorSolutionCache();
+      RealVectorEqualityComparer comp = new RealVectorEqualityComparer();
+
+      for (int i = 0; i < nrOfVectors; i++) {
+        RealVector vector = new RealVector(vectorLength, rand, -20, 30);
+        RealVectorSolutionInformation info = new RealVectorSolutionInformation();
+
+        //should be added
+        info.ProducedBy = ProducedBy.Crossover;
+        solutionCache.Add(vector, info);
+
+        //should be added
+        info = new RealVectorSolutionInformation();
+        info.ProducedBy = ProducedBy.Move;
+        solutionCache.Add(vector, info);
+
+        //should be added
+        info = new RealVectorSolutionInformation();
+        info.ProducedBy = ProducedBy.Move;
+        info.Generation = 20;
+        solutionCache.Add(vector, info);
+
+        //should not be added
+        info = new RealVectorSolutionInformation();
+        info.ProducedBy = ProducedBy.Crossover;
+        solutionCache.Add(vector, info);
+      }
+
+      foreach (var value in solutionCache.Values()) {
+        Assert.AreEqual(3, value.Count);
+      }
+
+      foreach (var key in solutionCache.Keys()) {
+        int cnt = solutionCache.Keys().Count(x => comp.Equals(key, x));
+        Assert.AreEqual(1, cnt);
+      }
+    }
+  }
+}
