Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -41,5 +41,5 @@
 #include "Fragmentation/Graph.hpp"
 #include "Fragmentation/HydrogenSaturation_enum.hpp"
-#include "Graph/CheckAgainstAdjacencyFile.hpp"
+#include "Graph/AdjacencyList.hpp"
 #include "Graph/DepthFirstSearchAnalysis.hpp"
 #include "Helpers/defs.hpp"
@@ -95,5 +95,5 @@
   filename = params.prefix.get() + ADJACENCYFILE;
   File.open(filename.c_str(), ios::out);
-  CheckAgainstAdjacencyFile FileChecker(File);
+  AdjacencyList FileChecker(File);
 
   DepthFirstSearchAnalysis DFS;
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ src/Fragmentation/Fragmentation.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -54,5 +54,5 @@
 #include "Fragmentation/UniqueFragments.hpp"
 #include "Graph/BondGraph.hpp"
-#include "Graph/CheckAgainstAdjacencyFile.hpp"
+#include "Graph/AdjacencyList.hpp"
 #include "Graph/ListOfLocalAtoms.hpp"
 #include "molecule.hpp"
@@ -66,5 +66,5 @@
  * \param _saturation whether to treat hydrogen special and saturate dangling bonds or not
  */
-Fragmentation::Fragmentation(molecule *_mol, CheckAgainstAdjacencyFile &_FileChecker, const enum HydrogenSaturation _saturation) :
+Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation) :
   mol(_mol),
   saturation(_saturation),
@@ -124,5 +124,5 @@
   {
     const std::vector<atomId_t> globalids = getGlobalIdsFromLocalIds(*mol, atomids);
-    FragmentationToDo = FragmentationToDo && FileChecker(globalids);
+    FragmentationToDo = FragmentationToDo && FileChecker.CheckAgainstSubset(globalids);
   }
 
Index: src/Fragmentation/Fragmentation.hpp
===================================================================
--- src/Fragmentation/Fragmentation.hpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ src/Fragmentation/Fragmentation.hpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -27,5 +27,5 @@
 class atom;
 class AtomMask_t;
-class CheckAgainstAdjacencyFile;
+class AdjacencyList;
 class KeySet;
 class molecule;
@@ -34,5 +34,5 @@
 {
 public:
-  Fragmentation(molecule *_mol, CheckAgainstAdjacencyFile &_FileChecker, const enum HydrogenSaturation _saturation);
+  Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation);
   ~Fragmentation();
 
@@ -64,5 +64,5 @@
   const enum HydrogenSaturation saturation;
   //!> reference to an external adjacency for comparison
-  CheckAgainstAdjacencyFile &FileChecker;
+  AdjacencyList &FileChecker;
   //!> Resulting Graph with all keysets
   Graph TotalGraph;
Index: src/Graph/AdjacencyList.cpp
===================================================================
--- src/Graph/AdjacencyList.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Graph/AdjacencyList.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -0,0 +1,266 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * AdjacencyList.cpp
+ *
+ *  Created on: Mar 3, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <iostream>
+#include <map>
+#include <set>
+#include <utility>
+
+#include "AdjacencyList.hpp"
+
+#include "Atom/atom.hpp"
+#include "Bond/bond.hpp"
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Range.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Helpers/defs.hpp"
+#include "World.hpp"
+
+/** Constructor of class AdjacencyList.
+ *
+ * \param File file to parser
+ */
+AdjacencyList::AdjacencyList(std::istream &File) :
+  NonMatchNumber(0)
+{
+  bool status = ParseInInternalMap(File);
+  if (!status) // remove map if failed to parse
+    InternalAtomBondMap.clear();
+}
+
+AdjacencyList::~AdjacencyList()
+{}
+
+/** Parses the bond partners of each atom from an external file into \a AtomBondMap.
+ *
+ * @param File file to parse
+ * @return true - everything ok, false - error while parsing
+ */
+bool AdjacencyList::ParseInInternalMap(std::istream &File)
+{
+  if (File.fail()) {
+    LOG(1, "STATUS: Adjacency file not found." << endl);
+    return false;
+  }
+
+  InternalAtomBondMap.clear();
+  char buffer[MAXSTRINGSIZE];
+  int tmp;
+  // Parse the file line by line and count the bonds
+  while (!File.eof()) {
+    File.getline(buffer, MAXSTRINGSIZE);
+    stringstream line;
+    line.str(buffer);
+    int AtomNr = -1;
+    line >> AtomNr;
+    // parse into structure
+    if (AtomNr > 0) {
+      const atom *Walker = World::getInstance().getAtom(AtomById(AtomNr-1));
+      if (Walker == NULL)
+        return false;
+      const atomId_t WalkerId = Walker->getId();
+      // parse bond partner ids associated to AtomNr
+      while (line >> ws >> tmp) {
+        LOG(3, "INFO: Recognized bond partner " << tmp-1 << " for " << WalkerId << ".");
+        InternalAtomBondMap.insert( std::make_pair(WalkerId, tmp-1) );
+      }
+    } else {
+      if (AtomNr != -1) {
+        ELOG(2, AtomNr << " is negative.");
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+/** Fills the InternalAtomBondMap from the atoms given by the two iterators.
+ *
+ * @param atomids set of atomic ids to check (must be global ids, i.e. from atom::getId())
+ */
+void AdjacencyList::CreateExternalMap(const atomids_t &atomids)
+{
+  ExternalAtomBondMap.clear();
+  // go through each atom in the list
+  for (atomids_t::const_iterator iter = atomids.begin(); iter != atomids.end(); ++iter) {
+    const atomId_t WalkerId = *iter;
+    ASSERT(WalkerId != (size_t)-1,
+        "AdjacencyList::CreateExternalMap() - Walker has no id.");
+    const atom *Walker = World::getInstance().getAtom(AtomById(WalkerId));
+    ASSERT( Walker != NULL,
+        "AdjacencyList::CreateExternalMap() - Walker id "+toString(*iter)
+        +" is not associated to any of World's atoms.");
+    const BondList& ListOfBonds = Walker->getListOfBonds();
+    // go through each of its bonds
+    for (BondList::const_iterator Runner = ListOfBonds.begin();
+        Runner != ListOfBonds.end();
+        ++Runner) {
+      const atomId_t id = (*Runner)->GetOtherAtom(Walker)->getId();
+      ASSERT(id != (size_t)-1,
+          "AdjacencyList::CreateExternalMap() - OtherAtom has not id.");
+      ExternalAtomBondMap.insert( std::make_pair(WalkerId, id) );
+    }
+  }
+}
+
+/** Checks contents of adjacency file against bond structure in structure molecule.
+ * \return true - structure is equal, false - not equivalence
+ */
+bool AdjacencyList::CheckAgainstSubset(const atomids_t &atomids)
+{
+  LOG(0, "STATUS: Looking at bond structure of given ids and comparing against stored in adjacency file... ");
+
+  // parse in external map
+  CreateExternalMap(atomids);
+
+  bool status = CompareInternalExternalMap();
+  if (status) { // if equal we parse the KeySetFile
+    LOG(0, "STATUS: Equal.");
+  } else
+    LOG(0, "STATUS: Not equal by " << NonMatchNumber << " atoms.");
+  return status;
+}
+
+AdjacencyList::KeysSet AdjacencyList::getKeys(const AdjacencyList::AtomBondRange &_range) const
+{
+  KeysSet Keys;
+  for (AtomBondMap::const_iterator iter = _range.first;
+      iter != _range.second;
+      ++iter) {
+    Keys.insert( iter->first );
+  }
+  return Keys;
+}
+
+AdjacencyList::ValuesSet AdjacencyList::getValues(const AdjacencyList::AtomBondRange&_range) const
+{
+  ValuesSet Values;
+  for (AtomBondMap::const_iterator iter = _range.first;
+      iter != _range.second;
+      ++iter) {
+    Values.insert( iter->second );
+  }
+  return Values;
+}
+
+/** Counts the number of items in the second set not present in the first set.
+ *
+ * \note We assume that the sets are sorted.
+ *
+ * @param firstset check set
+ * @param secondset reference set
+ * @return number of items in the first set that are missing in the second
+ */
+template <class T>
+size_t getMissingItems(const T &firstset, const T &secondset)
+{
+  size_t Mismatch = 0;
+  typename T::const_iterator firstiter = firstset.begin();
+  typename T::const_iterator seconditer = secondset.begin();
+  for (; (firstiter != firstset.end()) && (seconditer != secondset.end());) {
+    if (*firstiter > *seconditer)
+      ++seconditer;
+    else {
+      if (*firstiter < *seconditer)
+        ++Mismatch;
+      ++firstiter;
+    }
+  }
+  return Mismatch;
+}
+
+/** Compares InternalAtomBondMap and ExternalAtomBondMap and sets NonMatchNumber.
+ *
+ * @return true - both maps are the same, false - both maps diverge by NonMatchNumber counts.
+ */
+bool AdjacencyList::CompareInternalExternalMap()
+{
+  NonMatchNumber = 0;
+  // extract keys and check whether they match
+  const AtomBondRange Intrange(InternalAtomBondMap.begin(), InternalAtomBondMap.end());
+  const AtomBondRange Extrange(ExternalAtomBondMap.begin(), ExternalAtomBondMap.end());
+  KeysSet InternalKeys( getKeys(Intrange) );
+  KeysSet ExternalKeys( getKeys(Extrange) );
+
+//  std::cout << "InternalKeys: " << InternalKeys << std::endl;
+//  std::cout << "ExternalKeys: " << ExternalKeys << std::endl;
+
+  // check for same amount of keys
+  if (ExternalKeys.size() > InternalKeys.size()) {
+    NonMatchNumber = (int)ExternalKeys.size() - (int)InternalKeys.size();
+    LOG(2, "INFO: Number of external keys exceeds internal one by " << NonMatchNumber << ".");
+    return false;
+  }
+
+  // check which keys are missing in the internal set
+  NonMatchNumber = getMissingItems(ExternalKeys, InternalKeys);
+
+  if (NonMatchNumber != 0) {
+    LOG(2, "INFO: " << NonMatchNumber << " keys are not the same.");
+    return false;
+  }
+
+  // now check each map per key
+  for (KeysSet::const_iterator keyIter = ExternalKeys.begin();
+      keyIter != ExternalKeys.end();
+      ++keyIter) {
+//    std::cout << "Current key is " << *keyIter << std::endl;
+    const AtomBondRange IntRange( InternalAtomBondMap.equal_range(*keyIter) );
+    const AtomBondRange ExtRange( ExternalAtomBondMap.equal_range(*keyIter) );
+    ValuesSet InternalValues( getValues(IntRange) );
+    ValuesSet ExternalValues( getValues(ExtRange) );
+    // throw out all values not present in ExternalKeys
+    ValuesSet ExternalValues_temp( ExternalValues );
+    for(KeysSet::const_iterator iter = ExternalKeys.begin();
+        iter != ExternalKeys.end(); ++iter)
+      ExternalValues_temp.erase(*iter);
+    // all remaining values must be masked out
+    for (ValuesSet::const_iterator iter = ExternalValues_temp.begin();
+        iter != ExternalValues_temp.end(); ++iter)
+      ExternalValues.erase(*iter);
+//    std::cout << "InternalValues: " << InternalValues << std::endl;
+//    std::cout << "ExternalValues: " << ExternalValues << std::endl;
+    NonMatchNumber += getMissingItems(ExternalValues, InternalValues);
+  }
+  if (NonMatchNumber != 0) {
+    LOG(2, "INFO: " << NonMatchNumber << " keys are not the same.");
+    return false;
+  } else {
+    LOG(2, "INFO: All keys are the same.");
+    return true;
+  }
+}
Index: src/Graph/AdjacencyList.hpp
===================================================================
--- src/Graph/AdjacencyList.hpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Graph/AdjacencyList.hpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -0,0 +1,63 @@
+/*
+ * AdjacencyList.hpp
+ *
+ *  Created on: Mar 3, 2011
+ *      Author: heber
+ */
+
+#ifndef ADJACENCYLIST_HPP_
+#define ADJACENCYLIST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iosfwd>
+#include <map>
+#include <set>
+
+#include "types.hpp"
+#include "World.hpp"
+
+class atom;
+
+/** This class contains the adjacency structure inside an internal map of atoms.
+ *
+ * The adjacency structure is either from a file or from a given set of atoms.
+ *
+ * We may compare a subset of atoms against this internal bond structure. It is
+ * true it is a true subset of the bond structure.
+ */
+class AdjacencyList
+{
+  //!> Unit test is granted access to internal data
+  friend class AdjacencyListTest;
+public:
+  typedef std::vector<atomId_t> atomids_t;
+
+  AdjacencyList(std::istream &File);
+  AdjacencyList(const atomids_t &atoms);
+  ~AdjacencyList();
+
+  bool CheckAgainstSubset(const atomids_t &atoms);
+
+private:
+  typedef std::set<atomId_t> KeysSet;
+  typedef std::set<atomId_t> ValuesSet;
+  typedef std::pair<atomId_t, atomId_t> AtomBondPair;
+  typedef std::multimap< atomId_t, atomId_t > AtomBondMap;
+  typedef std::pair<AtomBondMap::const_iterator, AtomBondMap::const_iterator> AtomBondRange;
+  AtomBondMap InternalAtomBondMap;
+  AtomBondMap ExternalAtomBondMap;
+  int NonMatchNumber;
+
+  KeysSet getKeys(const AtomBondRange &_range) const;
+  ValuesSet getValues(const AtomBondRange&_range) const;
+
+  void CreateExternalMap(const atomids_t &atoms);
+  bool ParseInInternalMap(std::istream &File);
+  bool CompareInternalExternalMap();
+};
+
+#endif /* ADJACENCYLIST_HPP_ */
Index: src/Graph/CheckAgainstAdjacencyFile.cpp
===================================================================
--- src/Graph/CheckAgainstAdjacencyFile.cpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ 	(revision )
@@ -1,266 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
- * 
- *
- *   This file is part of MoleCuilder.
- *
- *    MoleCuilder 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 2 of the License, or
- *    (at your option) any later version.
- *
- *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * CheckAgainstAdjacencyFile.cpp
- *
- *  Created on: Mar 3, 2011
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <iostream>
-#include <map>
-#include <set>
-#include <utility>
-
-#include "CheckAgainstAdjacencyFile.hpp"
-
-#include "Atom/atom.hpp"
-#include "Bond/bond.hpp"
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Log.hpp"
-#include "CodePatterns/Range.hpp"
-#include "Descriptors/AtomIdDescriptor.hpp"
-#include "Helpers/defs.hpp"
-#include "World.hpp"
-
-/** Constructor of class CheckAgainstAdjacencyFile.
- *
- * \param File file to parser
- */
-CheckAgainstAdjacencyFile::CheckAgainstAdjacencyFile(std::istream &File) :
-  NonMatchNumber(0)
-{
-  bool status = ParseInInternalMap(File);
-  if (!status) // remove map if failed to parse
-    InternalAtomBondMap.clear();
-}
-
-CheckAgainstAdjacencyFile::~CheckAgainstAdjacencyFile()
-{}
-
-/** Parses the bond partners of each atom from an external file into \a AtomBondMap.
- *
- * @param File file to parse
- * @return true - everything ok, false - error while parsing
- */
-bool CheckAgainstAdjacencyFile::ParseInInternalMap(std::istream &File)
-{
-  if (File.fail()) {
-    LOG(1, "STATUS: Adjacency file not found." << endl);
-    return false;
-  }
-
-  InternalAtomBondMap.clear();
-  char buffer[MAXSTRINGSIZE];
-  int tmp;
-  // Parse the file line by line and count the bonds
-  while (!File.eof()) {
-    File.getline(buffer, MAXSTRINGSIZE);
-    stringstream line;
-    line.str(buffer);
-    int AtomNr = -1;
-    line >> AtomNr;
-    // parse into structure
-    if (AtomNr > 0) {
-      const atom *Walker = World::getInstance().getAtom(AtomById(AtomNr-1));
-      if (Walker == NULL)
-        return false;
-      const atomId_t WalkerId = Walker->getId();
-      // parse bond partner ids associated to AtomNr
-      while (line >> ws >> tmp) {
-        LOG(3, "INFO: Recognized bond partner " << tmp-1 << " for " << WalkerId << ".");
-        InternalAtomBondMap.insert( std::make_pair(WalkerId, tmp-1) );
-      }
-    } else {
-      if (AtomNr != -1) {
-        ELOG(2, AtomNr << " is negative.");
-        return false;
-      }
-    }
-  }
-  return true;
-}
-
-/** Fills the InternalAtomBondMap from the atoms given by the two iterators.
- *
- * @param atomids set of atomic ids to check (must be global ids, i.e. from atom::getId())
- */
-void CheckAgainstAdjacencyFile::CreateExternalMap(const atomids_t &atomids)
-{
-  ExternalAtomBondMap.clear();
-  // go through each atom in the list
-  for (atomids_t::const_iterator iter = atomids.begin(); iter != atomids.end(); ++iter) {
-    const atomId_t WalkerId = *iter;
-    ASSERT(WalkerId != (size_t)-1,
-        "CheckAgainstAdjacencyFile::CreateExternalMap() - Walker has no id.");
-    const atom *Walker = World::getInstance().getAtom(AtomById(WalkerId));
-    ASSERT( Walker != NULL,
-        "CheckAgainstAdjacencyFile::CreateExternalMap() - Walker id "+toString(*iter)
-        +" is not associated to any of World's atoms.");
-    const BondList& ListOfBonds = Walker->getListOfBonds();
-    // go through each of its bonds
-    for (BondList::const_iterator Runner = ListOfBonds.begin();
-        Runner != ListOfBonds.end();
-        ++Runner) {
-      const atomId_t id = (*Runner)->GetOtherAtom(Walker)->getId();
-      ASSERT(id != (size_t)-1,
-          "CheckAgainstAdjacencyFile::CreateExternalMap() - OtherAtom has not id.");
-      ExternalAtomBondMap.insert( std::make_pair(WalkerId, id) );
-    }
-  }
-}
-
-/** Checks contents of adjacency file against bond structure in structure molecule.
- * \return true - structure is equal, false - not equivalence
- */
-bool CheckAgainstAdjacencyFile::operator()(const atomids_t &atomids)
-{
-  LOG(0, "STATUS: Looking at bond structure of given ids and comparing against stored in adjacency file... ");
-
-  // parse in external map
-  CreateExternalMap(atomids);
-
-  bool status = CompareInternalExternalMap();
-  if (status) { // if equal we parse the KeySetFile
-    LOG(0, "STATUS: Equal.");
-  } else
-    LOG(0, "STATUS: Not equal by " << NonMatchNumber << " atoms.");
-  return status;
-}
-
-CheckAgainstAdjacencyFile::KeysSet CheckAgainstAdjacencyFile::getKeys(const CheckAgainstAdjacencyFile::AtomBondRange &_range) const
-{
-  KeysSet Keys;
-  for (AtomBondMap::const_iterator iter = _range.first;
-      iter != _range.second;
-      ++iter) {
-    Keys.insert( iter->first );
-  }
-  return Keys;
-}
-
-CheckAgainstAdjacencyFile::ValuesSet CheckAgainstAdjacencyFile::getValues(const CheckAgainstAdjacencyFile::AtomBondRange&_range) const
-{
-  ValuesSet Values;
-  for (AtomBondMap::const_iterator iter = _range.first;
-      iter != _range.second;
-      ++iter) {
-    Values.insert( iter->second );
-  }
-  return Values;
-}
-
-/** Counts the number of items in the second set not present in the first set.
- *
- * \note We assume that the sets are sorted.
- *
- * @param firstset check set
- * @param secondset reference set
- * @return number of items in the first set that are missing in the second
- */
-template <class T>
-size_t getMissingItems(const T &firstset, const T &secondset)
-{
-  size_t Mismatch = 0;
-  typename T::const_iterator firstiter = firstset.begin();
-  typename T::const_iterator seconditer = secondset.begin();
-  for (; (firstiter != firstset.end()) && (seconditer != secondset.end());) {
-    if (*firstiter > *seconditer)
-      ++seconditer;
-    else {
-      if (*firstiter < *seconditer)
-        ++Mismatch;
-      ++firstiter;
-    }
-  }
-  return Mismatch;
-}
-
-/** Compares InternalAtomBondMap and ExternalAtomBondMap and sets NonMatchNumber.
- *
- * @return true - both maps are the same, false - both maps diverge by NonMatchNumber counts.
- */
-bool CheckAgainstAdjacencyFile::CompareInternalExternalMap()
-{
-  NonMatchNumber = 0;
-  // extract keys and check whether they match
-  const AtomBondRange Intrange(InternalAtomBondMap.begin(), InternalAtomBondMap.end());
-  const AtomBondRange Extrange(ExternalAtomBondMap.begin(), ExternalAtomBondMap.end());
-  KeysSet InternalKeys( getKeys(Intrange) );
-  KeysSet ExternalKeys( getKeys(Extrange) );
-
-//  std::cout << "InternalKeys: " << InternalKeys << std::endl;
-//  std::cout << "ExternalKeys: " << ExternalKeys << std::endl;
-
-  // check for same amount of keys
-  if (ExternalKeys.size() > InternalKeys.size()) {
-    NonMatchNumber = (int)ExternalKeys.size() - (int)InternalKeys.size();
-    LOG(2, "INFO: Number of external keys exceeds internal one by " << NonMatchNumber << ".");
-    return false;
-  }
-
-  // check which keys are missing in the internal set
-  NonMatchNumber = getMissingItems(ExternalKeys, InternalKeys);
-
-  if (NonMatchNumber != 0) {
-    LOG(2, "INFO: " << NonMatchNumber << " keys are not the same.");
-    return false;
-  }
-
-  // now check each map per key
-  for (KeysSet::const_iterator keyIter = ExternalKeys.begin();
-      keyIter != ExternalKeys.end();
-      ++keyIter) {
-//    std::cout << "Current key is " << *keyIter << std::endl;
-    const AtomBondRange IntRange( InternalAtomBondMap.equal_range(*keyIter) );
-    const AtomBondRange ExtRange( ExternalAtomBondMap.equal_range(*keyIter) );
-    ValuesSet InternalValues( getValues(IntRange) );
-    ValuesSet ExternalValues( getValues(ExtRange) );
-    // throw out all values not present in ExternalKeys
-    ValuesSet ExternalValues_temp( ExternalValues );
-    for(KeysSet::const_iterator iter = ExternalKeys.begin();
-        iter != ExternalKeys.end(); ++iter)
-      ExternalValues_temp.erase(*iter);
-    // all remaining values must be masked out
-    for (ValuesSet::const_iterator iter = ExternalValues_temp.begin();
-        iter != ExternalValues_temp.end(); ++iter)
-      ExternalValues.erase(*iter);
-//    std::cout << "InternalValues: " << InternalValues << std::endl;
-//    std::cout << "ExternalValues: " << ExternalValues << std::endl;
-    NonMatchNumber += getMissingItems(ExternalValues, InternalValues);
-  }
-  if (NonMatchNumber != 0) {
-    LOG(2, "INFO: " << NonMatchNumber << " keys are not the same.");
-    return false;
-  } else {
-    LOG(2, "INFO: All keys are the same.");
-    return true;
-  }
-}
Index: src/Graph/CheckAgainstAdjacencyFile.hpp
===================================================================
--- src/Graph/CheckAgainstAdjacencyFile.hpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * CheckAgainstAdjacencyFile.hpp
- *
- *  Created on: Mar 3, 2011
- *      Author: heber
- */
-
-#ifndef CHECKAGAINSTADJACENCYFILE_HPP_
-#define CHECKAGAINSTADJACENCYFILE_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iosfwd>
-#include <map>
-#include <set>
-
-#include "types.hpp"
-#include "World.hpp"
-
-class atom;
-
-/** This class contains the bond structure inside an internal map of atoms which
- * each bond neighbor parsed from an external file.
- *
- * We may compare a subset of atoms against this internal bond structure. It is
- * true it is a true subset of the bond structure.
- */
-class CheckAgainstAdjacencyFile
-{
-  //!> Unit test is granted access to internal data
-  friend class CheckAgainstAdjacencyFileTest;
-public:
-  CheckAgainstAdjacencyFile(std::istream &File);
-  ~CheckAgainstAdjacencyFile();
-
-  typedef std::vector<atomId_t> atomids_t;
-
-  bool operator()(const atomids_t &atoms);
-
-private:
-  typedef std::set<atomId_t> KeysSet;
-  typedef std::set<atomId_t> ValuesSet;
-  typedef std::pair<atomId_t, atomId_t> AtomBondPair;
-  typedef std::multimap< atomId_t, atomId_t > AtomBondMap;
-  typedef std::pair<AtomBondMap::const_iterator, AtomBondMap::const_iterator> AtomBondRange;
-  AtomBondMap InternalAtomBondMap;
-  AtomBondMap ExternalAtomBondMap;
-  int NonMatchNumber;
-
-  KeysSet getKeys(const AtomBondRange &_range) const;
-  ValuesSet getValues(const AtomBondRange&_range) const;
-
-  void CreateExternalMap(const atomids_t &atoms);
-  bool ParseInInternalMap(std::istream &File);
-  bool CompareInternalExternalMap();
-};
-
-#endif /* CHECKAGAINSTADJACENCYFILE_HPP_ */
Index: src/Graph/Makefile.am
===================================================================
--- src/Graph/Makefile.am	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ src/Graph/Makefile.am	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -6,5 +6,5 @@
 	Graph/BreadthFirstSearchAdd.cpp \
 	Graph/BuildInducedSubgraph.cpp \
-	Graph/CheckAgainstAdjacencyFile.cpp \
+	Graph/AdjacencyList.cpp \
 	Graph/ConnectedSubgraph.cpp \
 	Graph/CyclicStructureAnalysis.cpp \
@@ -15,5 +15,5 @@
 	Graph/BreadthFirstSearchAdd.hpp \
 	Graph/BuildInducedSubgraph.hpp \
-	Graph/CheckAgainstAdjacencyFile.hpp \
+	Graph/AdjacencyList.hpp \
 	Graph/ConnectedSubgraph.hpp \
 	Graph/CyclicStructureAnalysis.hpp \
Index: src/Graph/unittests/AdjacencyListUnitTest.cpp
===================================================================
--- src/Graph/unittests/AdjacencyListUnitTest.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Graph/unittests/AdjacencyListUnitTest.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -0,0 +1,281 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * AdjacencyListUnitTest.cpp
+ *
+ *  Created on: Oct 17, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "AdjacencyListUnitTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <boost/lambda/lambda.hpp>
+#include <iostream>
+#include <iterator>
+#include <iostream>
+#include <vector>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Atom/atom.hpp"
+#include "Descriptors/AtomDescriptor.hpp"
+#include "Element/element.hpp"
+#include "Element/periodentafel.hpp"
+#include "Graph/AdjacencyList.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+#include "WorldTime.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( AdjacencyListTest );
+
+static std::string adjacencyfile ="\
+1 2\n\
+2 1 3\n\
+3 2 4\n\
+4 3 5\n\
+5 4 6\n\
+6 5 7\n\
+7 6 8\n\
+8 7 9\n\
+9 8 10\n\
+10 9\n";
+
+static std::string wrongadjacencyfile1 ="\
+1 2\n\
+2 1\n\
+4 5\n\
+5 4 6\n\
+6 5 7\n\
+7 6 8\n\
+8 7 9\n\
+9 8 10\n\
+10 9\n";
+
+static std::string wrongadjacencyfile2 ="\
+1 2\n\
+2 1 3\n\
+3 2 4\n\
+4 3 5\n\
+5 4 6\n\
+6 5 7\n\
+7 6 8\n\
+8 7 9\n\
+9 8 10\n\
+10 9 11\n\
+11 10";
+
+static std::string wrongadjacencyfile3 ="\
+1 2\n\
+2 1 3\n\
+3 2 4\n\
+4 3 5\n\
+5 4 7\n\
+6\n\
+7 5 8\n\
+8 7 9\n\
+9 8 10\n\
+10 9 11\n\
+11 10";
+
+// set up and tear down
+void AdjacencyListTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  const element *hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL);
+
+  TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL);
+  for(int i=0;i<ATOM_COUNT;++i){
+    atom *_atom = World::getInstance().createAtom();
+    CPPUNIT_ASSERT(_atom != NULL);
+    _atom->setType(hydrogen);
+    TestMolecule->AddAtom(_atom);
+    atoms.push_back(_atom);
+    atomIds.push_back(_atom->getId());
+  }
+  CPPUNIT_ASSERT_EQUAL( (size_t)ATOM_COUNT, atoms.size());
+  CPPUNIT_ASSERT_EQUAL( (size_t)ATOM_COUNT, atomIds.size());
+  // create linear chain
+  for(int i=0;i<ATOM_COUNT-1;++i)
+    atoms[i]->addBond(WorldTime::getTime(), atoms[i+1]);
+
+  // create map as it should be
+  for(int i=0;i<ATOM_COUNT;++i) {
+    if (i != 0) // first has only one bond
+      comparisonMap.insert( std::make_pair(atomIds[i], atomIds[i-1]) );
+    if (i != ATOM_COUNT-1) // last has only one bond
+      comparisonMap.insert( std::make_pair(atomIds[i], atomIds[i+1]) );
+  }
+}
+
+void AdjacencyListTest::tearDown()
+{
+  comparisonMap.clear();
+
+  // destroy molecule and contained atoms
+  TestMolecule->removeAtomsinMolecule();
+  World::getInstance().destroyMolecule(TestMolecule);
+  // destroy World
+  World::purgeInstance();
+//  logger::purgeInstance();
+//  errorLogger::purgeInstance();
+}
+
+/** Unit tests for AdjacencyList::CreateExternalMap().
+ *
+ */
+void AdjacencyListTest::CreateExternalMapTest()
+{
+  std::stringstream input;
+  AdjacencyList fileChecker(input);
+  fileChecker.CreateExternalMap(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() );
+
+  // check equality
+  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.ExternalAtomBondMap.size() );
+//  std::cout << "comparisonMap: " << comparisonMap << std::endl;
+//  std::cout << "fileChecker.InternalAtomBondMap: " << fileChecker.InternalAtomBondMap << std::endl;
+  CPPUNIT_ASSERT( comparisonMap == fileChecker.ExternalAtomBondMap );
+
+  // check non-equality: more
+  comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
+  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
+  comparisonMap.erase((atomId_t)10);
+
+  // check non-equality: less
+  comparisonMap.erase((atomId_t)9);
+  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
+}
+
+/** Unit tests for AdjacencyList::ParseInInternalMap().
+ *
+ */
+void AdjacencyListTest::ParseInInternalMapTest()
+{
+  std::stringstream input(adjacencyfile);
+  AdjacencyList fileChecker(input);
+  std::vector<atomId_t> noids;
+  fileChecker.CreateExternalMap(noids);
+
+  // 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() );
+
+  // check equality
+  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.InternalAtomBondMap.size() );
+  CPPUNIT_ASSERT( comparisonMap == fileChecker.InternalAtomBondMap );
+
+  // check non-equality: more
+  comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
+  CPPUNIT_ASSERT( comparisonMap != fileChecker.InternalAtomBondMap );
+  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()
+{
+  std::stringstream input(adjacencyfile);
+  AdjacencyList fileChecker(input);
+
+  // 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() );
+
+  // parse in external map
+  fileChecker.CreateExternalMap(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() );
+}
+
+/** Unit tests for AdjacencyList::operator()().
+ *
+ */
+void AdjacencyListTest::CheckAgainstSubsetTest()
+{
+  {
+    // parse right
+    std::stringstream input(adjacencyfile);
+    AdjacencyList fileChecker(input);
+    CPPUNIT_ASSERT( fileChecker.CheckAgainstSubset(atomIds) );
+  }
+  {
+    // parse wrong1 (more atoms in the world than in file, hence wrong)
+    std::stringstream input(wrongadjacencyfile1);
+    AdjacencyList fileChecker(input);
+    CPPUNIT_ASSERT( !fileChecker.CheckAgainstSubset(atomIds) );
+  }
+  {
+    // remove third atom (index starts at 0) and test for equality then
+    std::vector<atomId_t> validids;
+    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() );
+    // parse wrong1 (more atoms in the world than in file, hence wrong)
+    std::stringstream input(wrongadjacencyfile1);
+    AdjacencyList fileChecker(input);
+    CPPUNIT_ASSERT( fileChecker.CheckAgainstSubset(validids) );
+  }
+  {
+    // 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)
+    std::stringstream input(wrongadjacencyfile3);
+    AdjacencyList fileChecker(input);
+    CPPUNIT_ASSERT( !fileChecker.CheckAgainstSubset(atomIds) );
+  }
+}
Index: src/Graph/unittests/AdjacencyListUnitTest.hpp
===================================================================
--- src/Graph/unittests/AdjacencyListUnitTest.hpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Graph/unittests/AdjacencyListUnitTest.hpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -0,0 +1,54 @@
+/*
+ * AdjacencyListUnitTest.hpp
+ *
+ *  Created on: Oct 17, 2011
+ *      Author: heber
+ */
+
+#ifndef UNITTEST_HPP_
+#define UNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "Graph/AdjacencyList.hpp"
+#include "types.hpp"
+
+// we prefer enum over define
+enum { ATOM_COUNT = 10 };
+
+class atom;
+class molecule;
+class World;
+
+class AdjacencyListTest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( AdjacencyListTest );
+  CPPUNIT_TEST ( CreateExternalMapTest );
+  CPPUNIT_TEST ( ParseInInternalMapTest );
+  CPPUNIT_TEST ( CompareInternalExternalMapTest );
+  CPPUNIT_TEST ( CheckAgainstSubsetTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void CreateExternalMapTest();
+  void ParseInInternalMapTest();
+  void CompareInternalExternalMapTest();
+  void CheckAgainstSubsetTest();
+
+private:
+  AdjacencyList::AtomBondMap comparisonMap;
+  std::vector<atom *> atoms;
+  std::vector<atomId_t> atomIds;
+  molecule * TestMolecule;
+};
+
+#endif /* UNITTEST_HPP_ */
Index: src/Graph/unittests/CheckAgainstAdjacencyFileUnitTest.cpp
===================================================================
--- src/Graph/unittests/CheckAgainstAdjacencyFileUnitTest.cpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ 	(revision )
@@ -1,281 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
- * 
- *
- *   This file is part of MoleCuilder.
- *
- *    MoleCuilder 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 2 of the License, or
- *    (at your option) any later version.
- *
- *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * CheckAgainstAdjacencyFileUnitTest.cpp
- *
- *  Created on: Oct 17, 2011
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CheckAgainstAdjacencyFileUnitTest.hpp"
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-
-#include <boost/lambda/lambda.hpp>
-#include <iostream>
-#include <iterator>
-#include <iostream>
-#include <vector>
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Log.hpp"
-
-#include "Atom/atom.hpp"
-#include "Descriptors/AtomDescriptor.hpp"
-#include "Element/element.hpp"
-#include "Element/periodentafel.hpp"
-#include "Graph/CheckAgainstAdjacencyFile.hpp"
-#include "molecule.hpp"
-#include "World.hpp"
-#include "WorldTime.hpp"
-
-#ifdef HAVE_TESTRUNNER
-#include "UnitTestMain.hpp"
-#endif /*HAVE_TESTRUNNER*/
-
-/********************************************** Test classes **************************************/
-// Registers the fixture into the 'registry'
-CPPUNIT_TEST_SUITE_REGISTRATION( CheckAgainstAdjacencyFileTest );
-
-static std::string adjacencyfile ="\
-1 2\n\
-2 1 3\n\
-3 2 4\n\
-4 3 5\n\
-5 4 6\n\
-6 5 7\n\
-7 6 8\n\
-8 7 9\n\
-9 8 10\n\
-10 9\n";
-
-static std::string wrongadjacencyfile1 ="\
-1 2\n\
-2 1\n\
-4 5\n\
-5 4 6\n\
-6 5 7\n\
-7 6 8\n\
-8 7 9\n\
-9 8 10\n\
-10 9\n";
-
-static std::string wrongadjacencyfile2 ="\
-1 2\n\
-2 1 3\n\
-3 2 4\n\
-4 3 5\n\
-5 4 6\n\
-6 5 7\n\
-7 6 8\n\
-8 7 9\n\
-9 8 10\n\
-10 9 11\n\
-11 10";
-
-static std::string wrongadjacencyfile3 ="\
-1 2\n\
-2 1 3\n\
-3 2 4\n\
-4 3 5\n\
-5 4 7\n\
-6\n\
-7 5 8\n\
-8 7 9\n\
-9 8 10\n\
-10 9 11\n\
-11 10";
-
-// set up and tear down
-void CheckAgainstAdjacencyFileTest::setUp()
-{
-  // failing asserts should be thrown
-  ASSERT_DO(Assert::Throw);
-
-  const element *hydrogen = World::getInstance().getPeriode()->FindElement(1);
-  CPPUNIT_ASSERT(hydrogen != NULL);
-
-  TestMolecule = World::getInstance().createMolecule();
-  CPPUNIT_ASSERT(TestMolecule != NULL);
-  for(int i=0;i<ATOM_COUNT;++i){
-    atom *_atom = World::getInstance().createAtom();
-    CPPUNIT_ASSERT(_atom != NULL);
-    _atom->setType(hydrogen);
-    TestMolecule->AddAtom(_atom);
-    atoms.push_back(_atom);
-    atomIds.push_back(_atom->getId());
-  }
-  CPPUNIT_ASSERT_EQUAL( (size_t)ATOM_COUNT, atoms.size());
-  CPPUNIT_ASSERT_EQUAL( (size_t)ATOM_COUNT, atomIds.size());
-  // create linear chain
-  for(int i=0;i<ATOM_COUNT-1;++i)
-    atoms[i]->addBond(WorldTime::getTime(), atoms[i+1]);
-
-  // create map as it should be
-  for(int i=0;i<ATOM_COUNT;++i) {
-    if (i != 0) // first has only one bond
-      comparisonMap.insert( std::make_pair(atomIds[i], atomIds[i-1]) );
-    if (i != ATOM_COUNT-1) // last has only one bond
-      comparisonMap.insert( std::make_pair(atomIds[i], atomIds[i+1]) );
-  }
-}
-
-void CheckAgainstAdjacencyFileTest::tearDown()
-{
-  comparisonMap.clear();
-
-  // destroy molecule and contained atoms
-  TestMolecule->removeAtomsinMolecule();
-  World::getInstance().destroyMolecule(TestMolecule);
-  // destroy World
-  World::purgeInstance();
-//  logger::purgeInstance();
-//  errorLogger::purgeInstance();
-}
-
-/** Unit tests for CheckAgainstAdjacencyFile::CreateExternalMap().
- *
- */
-void CheckAgainstAdjacencyFileTest::CreateExternalMapTest()
-{
-  std::stringstream input;
-  CheckAgainstAdjacencyFile fileChecker(input);
-  fileChecker.CreateExternalMap(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() );
-
-  // check equality
-  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.ExternalAtomBondMap.size() );
-//  std::cout << "comparisonMap: " << comparisonMap << std::endl;
-//  std::cout << "fileChecker.InternalAtomBondMap: " << fileChecker.InternalAtomBondMap << std::endl;
-  CPPUNIT_ASSERT( comparisonMap == fileChecker.ExternalAtomBondMap );
-
-  // check non-equality: more
-  comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
-  comparisonMap.erase((atomId_t)10);
-
-  // check non-equality: less
-  comparisonMap.erase((atomId_t)9);
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.ExternalAtomBondMap );
-}
-
-/** Unit tests for CheckAgainstAdjacencyFile::ParseInInternalMap().
- *
- */
-void CheckAgainstAdjacencyFileTest::ParseInInternalMapTest()
-{
-  std::stringstream input(adjacencyfile);
-  CheckAgainstAdjacencyFile fileChecker(input);
-  std::vector<atomId_t> noids;
-  fileChecker.CreateExternalMap(noids);
-
-  // 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() );
-
-  // check equality
-  CPPUNIT_ASSERT( comparisonMap.size() == fileChecker.InternalAtomBondMap.size() );
-  CPPUNIT_ASSERT( comparisonMap == fileChecker.InternalAtomBondMap );
-
-  // check non-equality: more
-  comparisonMap.insert( std::make_pair( (atomId_t)10, (atomId_t)8) );
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.InternalAtomBondMap );
-  comparisonMap.erase((atomId_t)10);
-
-  // check non-equality: less
-  comparisonMap.erase((atomId_t)9);
-  CPPUNIT_ASSERT( comparisonMap != fileChecker.InternalAtomBondMap );
-}
-
-/** Unit tests for CheckAgainstAdjacencyFile::CompareInternalExternalMap().
- *
- */
-void CheckAgainstAdjacencyFileTest::CompareInternalExternalMapTest()
-{
-  std::stringstream input(adjacencyfile);
-  CheckAgainstAdjacencyFile fileChecker(input);
-
-  // 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() );
-
-  // parse in external map
-  fileChecker.CreateExternalMap(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() );
-}
-
-/** Unit tests for CheckAgainstAdjacencyFile::operator()().
- *
- */
-void CheckAgainstAdjacencyFileTest::operatorTest()
-{
-  {
-    // parse right
-    std::stringstream input(adjacencyfile);
-    CheckAgainstAdjacencyFile fileChecker(input);
-    CPPUNIT_ASSERT( fileChecker(atomIds) );
-  }
-  {
-    // parse wrong1 (more atoms in the world than in file, hence wrong)
-    std::stringstream input(wrongadjacencyfile1);
-    CheckAgainstAdjacencyFile fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker(atomIds) );
-  }
-  {
-    // remove third atom (index starts at 0) and test for equality then
-    std::vector<atomId_t> validids;
-    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() );
-    // parse wrong1 (more atoms in the world than in file, hence wrong)
-    std::stringstream input(wrongadjacencyfile1);
-    CheckAgainstAdjacencyFile fileChecker(input);
-    CPPUNIT_ASSERT( fileChecker(validids) );
-  }
-  {
-    // parse wrong2 (there is no atom 10, but present in file. hence true)
-    std::stringstream input(wrongadjacencyfile2);
-    CheckAgainstAdjacencyFile fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker(atomIds) );
-  }
-  {
-    // parse wrong3 (6 is not connected)
-    std::stringstream input(wrongadjacencyfile3);
-    CheckAgainstAdjacencyFile fileChecker(input);
-    CPPUNIT_ASSERT( !fileChecker(atomIds) );
-  }
-}
Index: src/Graph/unittests/CheckAgainstAdjacencyFileUnitTest.hpp
===================================================================
--- src/Graph/unittests/CheckAgainstAdjacencyFileUnitTest.hpp	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- * CheckAgainstAdjacencyFileUnitTest.hpp
- *
- *  Created on: Oct 17, 2011
- *      Author: heber
- */
-
-#ifndef CHECKADJACENCYAGAINSTFILEUNITTEST_HPP_
-#define CHECKADJACENCYAGAINSTFILEUNITTEST_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include <cppunit/extensions/HelperMacros.h>
-
-#include "Graph/CheckAgainstAdjacencyFile.hpp"
-#include "types.hpp"
-
-// we prefer enum over define
-enum { ATOM_COUNT = 10 };
-
-class atom;
-class molecule;
-class World;
-
-class CheckAgainstAdjacencyFileTest : public CppUnit::TestFixture
-{
-  CPPUNIT_TEST_SUITE( CheckAgainstAdjacencyFileTest );
-  CPPUNIT_TEST ( CreateExternalMapTest );
-  CPPUNIT_TEST ( ParseInInternalMapTest );
-  CPPUNIT_TEST ( CompareInternalExternalMapTest );
-  CPPUNIT_TEST ( operatorTest );
-  CPPUNIT_TEST_SUITE_END();
-
-public:
-  void setUp();
-  void tearDown();
-
-  void CreateExternalMapTest();
-  void ParseInInternalMapTest();
-  void CompareInternalExternalMapTest();
-  void operatorTest();
-
-private:
-  CheckAgainstAdjacencyFile::AtomBondMap comparisonMap;
-  std::vector<atom *> atoms;
-  std::vector<atomId_t> atomIds;
-  molecule * TestMolecule;
-};
-
-#endif /* CHECKADJACENCYAGAINSTFILEUNITTEST_HPP_ */
Index: src/Graph/unittests/Makefile.am
===================================================================
--- src/Graph/unittests/Makefile.am	(revision 91207d4b79b8e46e1a50f522302e766ddeff4fb8)
+++ src/Graph/unittests/Makefile.am	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
@@ -3,14 +3,14 @@
 
 GRAPHTESTSSOURCES = \
-	../Graph/unittests/BondGraphUnitTest.cpp \
-	../Graph/unittests/CheckAgainstAdjacencyFileUnitTest.cpp
+	../Graph/unittests/AdjacencyListUnitTest.cpp \
+	../Graph/unittests/BondGraphUnitTest.cpp
 
 GRAPHTESTSHEADERS = \
-	../Graph/unittests/BondGraphUnitTest.hpp \
-	../Graph/unittests/CheckAgainstAdjacencyFileUnitTest.hpp
+	../Graph/unittests/AdjacencyListUnitTest.hpp \
+	../Graph/unittests/BondGraphUnitTest.hpp
 
 GRAPHTESTS = \
-	BondGraphUnitTest \
-	CheckAgainstAdjacencyFileUnitTest
+	AdjacencyListUnitTest \
+	BondGraphUnitTest
 
 
@@ -32,4 +32,9 @@
 
 
+AdjacencyListUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Graph/unittests/AdjacencyListUnitTest.cpp \
+	../Graph/unittests/AdjacencyListUnitTest.hpp
+AdjacencyListUnitTest_LDADD = ${ALLLIBS}
+
 BondGraphUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
 	../Graph/unittests/BondGraphUnitTest.cpp \
@@ -37,9 +42,4 @@
 BondGraphUnitTest_LDADD = ${GRAPHLIBS}
 
-CheckAgainstAdjacencyFileUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
-	../Graph/unittests/CheckAgainstAdjacencyFileUnitTest.cpp \
-	../Graph/unittests/CheckAgainstAdjacencyFileUnitTest.hpp
-CheckAgainstAdjacencyFileUnitTest_LDADD = ${ALLLIBS}
-
 
 
