Index: src/Graph/unittests/AdjacencyListUnitTest.cpp
===================================================================
--- src/Graph/unittests/AdjacencyListUnitTest.cpp	(revision 5197e543aadb7e0a5343495b6e246005819cd457)
+++ src/Graph/unittests/AdjacencyListUnitTest.cpp	(revision 3aa8a59c4b8e2d177c403ddd9d9ddb5524e3df0d)
@@ -65,5 +65,5 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( AdjacencyListTest );
 
-static std::string adjacencyfile ="\
+const std::string adjacencyfile ="\
 1 2\n\
 2 1 3\n\
@@ -77,5 +77,5 @@
 10 9\n";
 
-static std::string wrongadjacencyfile1 ="\
+const std::string wrongadjacencyfile1 ="\
 1 2\n\
 2 1\n\
@@ -88,5 +88,5 @@
 10 9\n";
 
-static std::string wrongadjacencyfile2 ="\
+const std::string wrongadjacencyfile2 ="\
 1 2\n\
 2 1 3\n\
@@ -99,7 +99,7 @@
 9 8 10\n\
 10 9 11\n\
-11 10";
-
-static std::string wrongadjacencyfile3 ="\
+11 10\n";
+
+const std::string wrongadjacencyfile3 ="\
 1 2\n\
 2 1 3\n\
@@ -111,6 +111,5 @@
 8 7 9\n\
 9 8 10\n\
-10 9 11\n\
-11 10";
+10 9\n";
 
 // set up and tear down
@@ -167,25 +166,25 @@
 {
   std::stringstream input;
-  AdjacencyList fileChecker(input);
-  fileChecker.CreateMap(atomIds, fileChecker.ExternalAtomBondMap);
+  AdjacencyList FileAdjacency(input);
+  AdjacencyList WorldAdjacency(atomIds);
 
   // check size (it's 8*2 + 2*1 = 18 keys)
-  CPPUNIT_ASSERT_EQUAL( (size_t)18, fileChecker.ExternalAtomBondMap.size() );
-  CPPUNIT_ASSERT_EQUAL( (size_t)0, fileChecker.InternalAtomBondMap.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)18, WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, FileAdjacency.atombondmap.size() );
 
   // check equality
-  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.ExternalAtomBondMap.size() );
+  CPPUNIT_ASSERT( comparisonMap.size() == WorldAdjacency.atombondmap.size() );
 //  std::cout << "comparisonMap: " << comparisonMap << std::endl;
-//  std::cout << "fileChecker.InternalAtomBondMap: " << fileChecker.InternalAtomBondMap << std::endl;
-  CPPUNIT_ASSERT( comparisonMap == fileChecker.ExternalAtomBondMap );
+//  std::cout << "WorldAdjacency.atombondmap: " << WorldAdjacency.atombondmap << std::endl;
+  CPPUNIT_ASSERT( comparisonMap == WorldAdjacency.atombondmap );
 
   // check non-equality: more
   comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
+  CPPUNIT_ASSERT( comparisonMap != WorldAdjacency.atombondmap );
   comparisonMap.erase((atomId_t)10);
 
   // check non-equality: less
   comparisonMap.erase((atomId_t)9);
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
+  CPPUNIT_ASSERT( comparisonMap != WorldAdjacency.atombondmap );
 }
 
@@ -196,46 +195,93 @@
 {
   std::stringstream input(adjacencyfile);
-  AdjacencyList fileChecker(input);
-  std::vector<atomId_t> noids;
-  fileChecker.CreateMap(noids, fileChecker.ExternalAtomBondMap);
+  AdjacencyList FileAdjacency(input);
+  AdjacencyList WorldAdjacency;
 
   // check size (it's 8*2 + 2*1 = 18 keys)
-  CPPUNIT_ASSERT_EQUAL( (size_t)0, fileChecker.ExternalAtomBondMap.size() );
-  CPPUNIT_ASSERT_EQUAL( (size_t)18, fileChecker.InternalAtomBondMap.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)18, FileAdjacency.atombondmap.size() );
 
   // check equality
-  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.InternalAtomBondMap.size() );
-  CPPUNIT_ASSERT( comparisonMap == fileChecker.InternalAtomBondMap );
+  CPPUNIT_ASSERT( comparisonMap.size() == FileAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT( comparisonMap == FileAdjacency.atombondmap );
 
   // check non-equality: more
   comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.InternalAtomBondMap );
+  CPPUNIT_ASSERT( comparisonMap != FileAdjacency.atombondmap );
   comparisonMap.erase((atomId_t)10);
 
   // check non-equality: less
   comparisonMap.erase((atomId_t)9);
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.InternalAtomBondMap );
-}
-
-/** Unit tests for AdjacencyList::CompareInternalExternalMap().
- *
- */
-void AdjacencyListTest::CompareInternalExternalMapTest()
+  CPPUNIT_ASSERT( comparisonMap != FileAdjacency.atombondmap );
+}
+
+/** Unit tests for AdjacencyList::StoreToFile().
+ *
+ */
+void AdjacencyListTest::StoreToFileTest()
 {
   std::stringstream input(adjacencyfile);
-  AdjacencyList fileChecker(input);
+  AdjacencyList FileAdjacency(input);
+
+  // check size (it's 8*2 + 2*1 = 18 keys)
+  CPPUNIT_ASSERT_EQUAL( (size_t)18, FileAdjacency.atombondmap.size() );
+
+  // store to file
+  std::stringstream output;
+  FileAdjacency.StoreToFile(output);
+  CPPUNIT_ASSERT_EQUAL( input.str(), output.str() );
+}
+
+/** Unit tests for AdjacencyList::operator<().
+ *
+ */
+void AdjacencyListTest::operatorGreaterLessTest()
+{
+  std::stringstream input(adjacencyfile);
+  AdjacencyList FileAdjacency(input);
+  AdjacencyList WorldAdjacency;
+
+  // assert empty set is subset of some filled set (empty sets should always return true)
+  CPPUNIT_ASSERT( FileAdjacency.atombondmap.size() != WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT( FileAdjacency.atombondmap != WorldAdjacency.atombondmap );
+  CPPUNIT_ASSERT( WorldAdjacency < FileAdjacency );
+  CPPUNIT_ASSERT( !(WorldAdjacency > FileAdjacency) );
+
+  // parse in external map
+  WorldAdjacency.CreateMap(atomIds);
+
+  // assert equality after parsing
+  CPPUNIT_ASSERT_EQUAL( FileAdjacency.atombondmap.size(), WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT_EQUAL( FileAdjacency.atombondmap, WorldAdjacency.atombondmap );
+  CPPUNIT_ASSERT( WorldAdjacency < FileAdjacency );
+  CPPUNIT_ASSERT( WorldAdjacency > FileAdjacency );
+
+  // remove one entry from the world
+  WorldAdjacency.atombondmap.erase((atomId_t)9);
+  CPPUNIT_ASSERT( WorldAdjacency < FileAdjacency );
+  CPPUNIT_ASSERT( !(WorldAdjacency > FileAdjacency) );
+}
+
+/** Unit tests for AdjacencyList::operator==().
+ *
+ */
+void AdjacencyListTest::operatorEqualTest()
+{
+  std::stringstream input(adjacencyfile);
+  AdjacencyList FileAdjacency(input);
+  AdjacencyList WorldAdjacency;
 
   // assert equality before parsing (empty sets should always return true)
-  CPPUNIT_ASSERT( fileChecker.ExternalAtomBondMap.size() != fileChecker.InternalAtomBondMap.size() );
-  CPPUNIT_ASSERT( fileChecker.ExternalAtomBondMap != fileChecker.InternalAtomBondMap );
-  CPPUNIT_ASSERT( fileChecker.CompareInternalExternalMap() );
+  CPPUNIT_ASSERT( FileAdjacency.atombondmap.size() != WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT( FileAdjacency.atombondmap != WorldAdjacency.atombondmap );
+  CPPUNIT_ASSERT( WorldAdjacency != FileAdjacency );
 
   // parse in external map
-  fileChecker.CreateMap(atomIds, fileChecker.ExternalAtomBondMap);
+  WorldAdjacency.CreateMap(atomIds);
 
   // assert equality after parsing
-  CPPUNIT_ASSERT_EQUAL( fileChecker.ExternalAtomBondMap.size(), fileChecker.InternalAtomBondMap.size() );
-  CPPUNIT_ASSERT_EQUAL( fileChecker.ExternalAtomBondMap, fileChecker.InternalAtomBondMap );
-  CPPUNIT_ASSERT( fileChecker.CompareInternalExternalMap() );
+  CPPUNIT_ASSERT_EQUAL( FileAdjacency.atombondmap.size(), WorldAdjacency.atombondmap.size() );
+  CPPUNIT_ASSERT_EQUAL( FileAdjacency.atombondmap, WorldAdjacency.atombondmap );
+  CPPUNIT_ASSERT( WorldAdjacency == FileAdjacency );
 }
 
@@ -245,15 +291,16 @@
 void AdjacencyListTest::CheckAgainstSubsetTest()
 {
+  AdjacencyList WorldAdjacency(atomIds);
   {
     // parse right
     std::stringstream input(adjacencyfile);
-    AdjacencyList fileChecker(input);
-    CPPUNIT_ASSERT( fileChecker.CheckAgainstSubset(atomIds) );
+    AdjacencyList FileAdjacency(input);
+    CPPUNIT_ASSERT( (WorldAdjacency > FileAdjacency) && (WorldAdjacency < FileAdjacency) );
   }
   {
     // parse wrong1 (more atoms in the world than in file, hence wrong)
     std::stringstream input(wrongadjacencyfile1);
-    AdjacencyList fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker.CheckAgainstSubset(atomIds) );
+    AdjacencyList FileAdjacency(input);
+    CPPUNIT_ASSERT( !(WorldAdjacency < FileAdjacency) && (WorldAdjacency > FileAdjacency) );
   }
   {
@@ -262,20 +309,23 @@
     std::remove_copy_if(atomIds.begin(), atomIds.end(), std::back_inserter(validids), boost::lambda::_1 == (atomId_t)2);
     CPPUNIT_ASSERT_EQUAL( (size_t)ATOM_COUNT-1, validids.size() );
+    AdjacencyList RestrictedWorldAdjacency(validids);
     // parse wrong1 (more atoms in the world than in file, hence wrong)
     std::stringstream input(wrongadjacencyfile1);
-    AdjacencyList fileChecker(input);
-    CPPUNIT_ASSERT( fileChecker.CheckAgainstSubset(validids) );
+    AdjacencyList FileAdjacency(input);
+    CPPUNIT_ASSERT( RestrictedWorldAdjacency == FileAdjacency );
   }
   {
     // parse wrong2 (there is no atom 10, but present in file. hence true)
     std::stringstream input(wrongadjacencyfile2);
-    AdjacencyList fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker.CheckAgainstSubset(atomIds) );
-  }
-  {
-    // parse wrong3 (6 is not connected)
+    AdjacencyList FileAdjacency(input);
+    CPPUNIT_ASSERT( !(WorldAdjacency > FileAdjacency) && (WorldAdjacency < FileAdjacency) );
+  }
+  {
+    // parse wrong3 (6 is skipped in connection, hence neither is subset)
     std::stringstream input(wrongadjacencyfile3);
-    AdjacencyList fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker.CheckAgainstSubset(atomIds) );
-  }
-}
+    AdjacencyList FileAdjacency(input);
+//    WorldAdjacency.StoreToFile((std::ostream &)std::cout);
+//    FileAdjacency.StoreToFile((std::ostream &)std::cout);
+    CPPUNIT_ASSERT( WorldAdjacency != FileAdjacency );
+  }
+}
Index: src/Graph/unittests/AdjacencyListUnitTest.hpp
===================================================================
--- src/Graph/unittests/AdjacencyListUnitTest.hpp	(revision 5197e543aadb7e0a5343495b6e246005819cd457)
+++ src/Graph/unittests/AdjacencyListUnitTest.hpp	(revision 3aa8a59c4b8e2d177c403ddd9d9ddb5524e3df0d)
@@ -32,5 +32,7 @@
   CPPUNIT_TEST ( CreateMapTest );
   CPPUNIT_TEST ( ParseIntoMapTest );
-  CPPUNIT_TEST ( CompareInternalExternalMapTest );
+  CPPUNIT_TEST ( StoreToFileTest );
+  CPPUNIT_TEST ( operatorGreaterLessTest );
+  CPPUNIT_TEST ( operatorEqualTest );
   CPPUNIT_TEST ( CheckAgainstSubsetTest );
   CPPUNIT_TEST_SUITE_END();
@@ -42,5 +44,7 @@
   void CreateMapTest();
   void ParseIntoMapTest();
-  void CompareInternalExternalMapTest();
+  void StoreToFileTest();
+  void operatorGreaterLessTest();
+  void operatorEqualTest();
   void CheckAgainstSubsetTest();
 
