Index: src/Fragmentation/Summation/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Summation/unittests/Makefile.am	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/unittests/Makefile.am	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
@@ -52,4 +52,9 @@
 	unittests/SetValueUnitTest.cpp \
 	unittests/SetValueUnitTest.hpp \
+	unittests/stubs/SetValueMap_Mock.hpp \
+	unittests/stubs/SubsetMap_Mock.hpp \
+	IndexSet.cpp \
+	IndexSet.hpp \
+	IndexSetContainer.hpp \
 	SetValue.hpp
 SetValueUnitTest_LDADD = ${FRAGMENTATIONSUMMATIONLIBS}
Index: src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp
===================================================================
--- src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
@@ -39,7 +39,11 @@
 #include <cppunit/ui/text/TestRunner.h>
 
+#include "Fragmentation/Summation/IndexSet.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
 #include "Fragmentation/Summation/SetValue.hpp"
 
 #include "SetValueUnitTest.hpp"
+#include "stubs/SetValueMap_Mock.hpp"
+#include "stubs/SubsetMap_Mock.hpp"
 
 #include <boost/assign.hpp>
@@ -58,4 +62,7 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( SetValueTest );
 
+LookupValue LV;
+LookupSubset LS;
+
 
 void SetValueTest::setUp()
@@ -63,6 +70,13 @@
   IndexSet set;
   set += 1,2,3,4;
-  indices = new IndexSet( set );
-  value = new SetValue<int>(*indices, VALUE);
+  indices.reset(new IndexSet( set ));
+  value.reset(new SetValue<int>(indices, VALUE));
+  SetValue<int>::lookupSubset =
+      boost::bind(&LookupSubset::getSubsets, boost::ref(LS), _1);
+  SetValue<int>::lookupValue =
+      boost::bind(&LookupValue::getValue, boost::ref(LV), _1);
+  LV.LookupMap.insert( std::make_pair(indices, value) );
+  //IndexSet_ptr emptyset(new IndexSet);
+  //LS.LookupMap.insert( std::make_pair(indices, IndexSetContainer::ptr( new IndexSetContainer(emptyset) )) );
 };
 
@@ -70,6 +84,4 @@
 void SetValueTest::tearDown()
 {
-  delete value;
-  delete indices;
 };
 
@@ -87,5 +99,5 @@
 void SetValueTest::operatorTest()
 {
-  SetValue<int> other(*indices, OTHER);
+  SetValue<int> other(indices, OTHER);
 
   // operator-=
@@ -99,2 +111,20 @@
   CPPUNIT_ASSERT_EQUAL( (int)VALUE - ((int)OTHER - (int)VALUE), value->getValue() );
 };
+
+void SetValueTest::getContributiontest()
+{
+  IndexSet set;
+  set += 1,2,3;
+  IndexSet_ptr otherindices(new IndexSet(set));
+  SetValue<int>::ptr othervalue(new SetValue<int>(otherindices, OTHER));
+  LV.LookupMap.insert( std::make_pair(otherindices, othervalue) );
+
+  // connect as subset
+  LS.LookupMap[indices].reset(new IndexSetContainer(otherindices));
+
+  std::cout << "The following error is intended and does not constitute a failure of the test." << std::endl;
+  CPPUNIT_ASSERT_EQUAL( (int)OTHER, othervalue->getContribution() );
+  CPPUNIT_ASSERT_EQUAL( 2, value->getContribution() );
+
+  LS.LookupMap.erase( indices );
+}
Index: src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp
===================================================================
--- src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
@@ -17,7 +17,6 @@
 #include <cppunit/extensions/HelperMacros.h>
 
+#include "Fragmentation/Summation/IndexSet.hpp"
 #include "Fragmentation/Summation/SetValue.hpp"
-
-class IndexSet;
 
 /********************************************** Test classes **************************************/
@@ -28,4 +27,5 @@
     CPPUNIT_TEST ( constructorTest );
     CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST ( getContributiontest );
     CPPUNIT_TEST_SUITE_END();
 
@@ -35,8 +35,9 @@
       void constructorTest();
       void operatorTest();
+      void getContributiontest();
 
 private:
-      IndexSet *indices;
-      SetValue<int> *value;
+      IndexSet::ptr indices;
+      SetValue<int>::ptr value;
 
 };
Index: src/Fragmentation/Summation/unittests/stubs/SetValueMap_Mock.hpp
===================================================================
--- src/Fragmentation/Summation/unittests/stubs/SetValueMap_Mock.hpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
+++ src/Fragmentation/Summation/unittests/stubs/SetValueMap_Mock.hpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
@@ -0,0 +1,41 @@
+/*
+ * SetValueMap_Mock.hpp
+ *
+ *  Created on: Jul 4, 2012
+ *      Author: heber
+ */
+
+#ifndef SETVALUEMAP_MOCK_HPP_
+#define SETVALUEMAP_MOCK_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <map>
+
+#include "Fragmentation/Summation/IndexSet.hpp"
+#include "Fragmentation/Summation/SetValue.hpp"
+
+class LookupValue {
+  typedef std::map<IndexSet::ptr, SetValue<int>::ptr > LookupMap_t;
+public:
+  LookupValue()
+  {}
+
+  SetValue<int>::ptr & getValue(const IndexSet::ptr &subset) {
+    LookupMap_t::iterator iter = LookupMap.find(subset);
+    if (iter == LookupMap.end())
+      return null_ptr;
+    else
+      return iter->second;
+  }
+  LookupMap_t LookupMap;
+private:
+  SetValue<int>::ptr null_ptr;
+};
+
+
+#endif /* SETVALUEMAP_MOCK_HPP_ */
Index: src/Fragmentation/Summation/unittests/stubs/SubsetMap_Mock.hpp
===================================================================
--- src/Fragmentation/Summation/unittests/stubs/SubsetMap_Mock.hpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
+++ src/Fragmentation/Summation/unittests/stubs/SubsetMap_Mock.hpp	(revision 30abdc71b9be0d957e3a2cbc4ed79217640753bb)
@@ -0,0 +1,42 @@
+/*
+ * SubsetMap_Mock.hpp
+ *
+ *  Created on: Jul 4, 2012
+ *      Author: heber
+ */
+
+#ifndef SUBSETMAP_MOCK_HPP_
+#define SUBSETMAP_MOCK_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <map>
+
+#include "Fragmentation/Summation/IndexSet.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+
+
+class LookupSubset {
+  typedef std::map<IndexSet::ptr, IndexSetContainer::ptr > LookupMap_t;
+public:
+  LookupSubset()
+  {}
+
+  IndexSetContainer::ptr & getSubsets(const IndexSet::ptr &subset) {
+    LookupMap_t::iterator iter = LookupMap.find(subset);
+    if (iter == LookupMap.end())
+      return empty_container;
+    else
+      return iter->second;
+  }
+  LookupMap_t LookupMap;
+private:
+  IndexSetContainer::ptr empty_container;
+};
+
+
+#endif /* SUBSETMAP_MOCK_HPP_ */
