Index: src/Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp
===================================================================
--- src/Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp	(revision 6e5b8dd8423dbdf1fe4c776b9a340f732f99558c)
+++ src/Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp	(revision 6e5b8dd8423dbdf1fe4c776b9a340f732f99558c)
@@ -0,0 +1,106 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. 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/>.
+ */
+
+/*
+ * BreadthFirstSearchGathererUnitTest.cpp
+ *
+ *  Created on: May 19, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <boost/assign.hpp>
+
+#include "CodePatterns/Log.hpp"
+
+#include "Graph/BoostGraphCreator.hpp"
+#include "Graph/BreadthFirstSearchGatherer.hpp"
+
+#include "BreadthFirstSearchGathererUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+using namespace boost::assign;
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( BreadthFirstSearchGathererTest );
+
+typedef std::pair<int,int> E;
+
+void BreadthFirstSearchGathererTest::setUp()
+{
+  BGCreator = new BoostGraphCreator();
+};
+
+
+void BreadthFirstSearchGathererTest::tearDown()
+{
+  delete BGCreator;
+};
+
+/** Little helper function to prepare a linear graph with vertices
+ * correctly named (not just indexed) and also the internal node
+ * map prepared.
+ */
+void BreadthFirstSearchGathererTest::prepareLinearGraph()
+{
+  E edges[] = { E(0,1), E(1,2), E(2,3), E(3,4) };
+  const size_t no_nodes = 5;
+  BGCreator->graph =
+      BoostGraphCreator::UndirectedGraph(edges, edges + sizeof(edges) / sizeof(E), no_nodes);
+  BGCreator->atomids_nodeids +=
+      make_pair(0,0), make_pair(1,1), make_pair(2,2), make_pair(3,3), make_pair(4,4);
+  for (size_t i=0;i<no_nodes;++i)
+    boost::put(boost::get(boost::vertex_name, BGCreator->graph), boost::vertex(i, BGCreator->graph), i+1);
+}
+
+/** Tests whether operator() works.
+ */
+void BreadthFirstSearchGathererTest::operatorTest()
+{
+  // create linear test graph
+  prepareLinearGraph();
+
+  // call operator with default argument
+  BreadthFirstSearchGatherer gatherer(*BGCreator);
+  std::vector<atomId_t> atomids = gatherer(0);
+
+  // create comparator set
+  std::vector<atomId_t> compareids;
+  compareids += 1,2,3,4,5;
+  CPPUNIT_ASSERT_EQUAL ((size_t)5, atomids.size());
+  CPPUNIT_ASSERT_EQUAL (compareids, atomids);
+};
Index: src/Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp
===================================================================
--- src/Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp	(revision 6e5b8dd8423dbdf1fe4c776b9a340f732f99558c)
+++ src/Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp	(revision 6e5b8dd8423dbdf1fe4c776b9a340f732f99558c)
@@ -0,0 +1,42 @@
+/*
+ * BreadthFirstSearchGathererUnitTest.hpp
+ *
+ *  Created on: May 19, 2017
+ *      Author: heber
+ */
+
+#ifndef BREADTHFIRSTSEARCHGATHERERUNITTEST_HPP_
+#define BREADTHFIRSTSEARCHGATHERERUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+struct BoostGraphCreator;
+
+/********************************************** Test classes **************************************/
+
+class BreadthFirstSearchGathererTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( BreadthFirstSearchGathererTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+
+private:
+      void prepareLinearGraph();
+
+private:
+
+      BoostGraphCreator *BGCreator;
+};
+
+#endif /* BREADTHFIRSTSEARCHGATHERERUNITTEST_HPP_ */
Index: src/Graph/unittests/Makefile.am
===================================================================
--- src/Graph/unittests/Makefile.am	(revision cb98f18bafc54f5ff073db8df06333ff42e29ee2)
+++ src/Graph/unittests/Makefile.am	(revision 6e5b8dd8423dbdf1fe4c776b9a340f732f99558c)
@@ -4,14 +4,16 @@
 GRAPHTESTSSOURCES = \
 	../Graph/unittests/AdjacencyListUnitTest.cpp \
-	../Graph/unittests/BondGraphUnitTest.cpp
+	../Graph/unittests/BondGraphUnitTest.cpp \
+	../Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp
 
 GRAPHTESTSHEADERS = \
 	../Graph/unittests/AdjacencyListUnitTest.hpp \
-	../Graph/unittests/BondGraphUnitTest.hpp
+	../Graph/unittests/BondGraphUnitTest.hpp \
+	../Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp
 
 GRAPHTESTS = \
 	AdjacencyListUnitTest \
-	BondGraphUnitTest
-
+	BondGraphUnitTest \
+	BreadthFirstSearchGathererUnitTest
 
 TESTS += $(GRAPHTESTS)
@@ -21,7 +23,7 @@
 GRAPHLIBS = \
 	libUnitTest.la \
+	../libMolecuilderGraph.la \
 	../libMolecuilder.la \
-	../libMolecuilderUI.la \
-	../libMolecuilderGraph.la
+	../libMolecuilderUI.la
 if CONDJOBMARKET
 GRAPHLIBS += \
@@ -45,4 +47,8 @@
 BondGraphUnitTest_LDADD = ${GRAPHLIBS}
 
+BreadthFirstSearchGathererUnitTest_SOURCES = \
+	../Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp \
+	../Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp
+BreadthFirstSearchGathererUnitTest_LDADD = ${GRAPHLIBS}
 
 
