Index: tests/regression/DiffFragmentResultContainer.cpp
===================================================================
--- tests/regression/DiffFragmentResultContainer.cpp	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
+++ tests/regression/DiffFragmentResultContainer.cpp	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
@@ -0,0 +1,114 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * DiffFragmentResultContainer.cpp
+ *
+ *  Created on: Apr 5, 2017
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/bind.hpp>
+
+#include <algorithm>
+#include <fstream>
+
+#include "Fragmentation/Summation/Containers/FragmentationResultContainer.hpp"
+
+static bool file_not_exists(const boost::filesystem::path &path) {
+  return !boost::filesystem::exists(path);
+}
+
+int main(int argc, char **argv)
+{
+  if (argc < 2) {
+    std::cout << "Usage:" << argv[0] << "<file 1> <file2>\n";
+    return 255;
+  }
+
+  // parse two file names
+  std::vector<boost::filesystem::path> filenames;
+  filenames.reserve(2);
+  filenames.push_back(std::string(argv[1]));
+  filenames.push_back(std::string(argv[2]));
+
+  // check whether both files exists
+  std::vector<boost::filesystem::path>::iterator iter =
+      std::find_if(
+          filenames.begin(), filenames.end(),
+          file_not_exists);
+  if (iter != filenames.end()) {
+    std::cerr << "The file " << iter->string() << " does not exist.\n";
+    return 255;
+  }
+
+  // deserialize and compare
+  // Note that because FragmentationResultContainer is a singleton, we cannot
+  // compare two distinct instances. Therefore, we deserialize and serialize
+  // again both files in order to compare the strings on grounds of the same
+  // serialization function (and library).
+  std::stringstream outfile1;
+  std::stringstream outfile2;
+  FragmentationResultContainer::purgeInstance();
+  {
+    std::ifstream infile(filenames[0].string().c_str());
+    FragmentationResultContainer &results = FragmentationResultContainer::getInstance();
+    boost::archive::text_iarchive ia(infile);
+    boost::archive::text_oarchive oa(outfile1);
+    ia >> results;
+    oa << results;
+  }
+  FragmentationResultContainer::purgeInstance();
+  {
+    std::ifstream infile(filenames[1].string().c_str());
+    FragmentationResultContainer &results = FragmentationResultContainer::getInstance();
+    boost::archive::text_iarchive ia(infile);
+    boost::archive::text_oarchive oa(outfile2);
+    ia >> results;
+    oa << results;
+  }
+
+  // because container is a singleton, we can only copy the memory
+
+  if (outfile1.str() != outfile2.str()) {
+    std::cout << "The two containers differ:\n";
+    std::cout << outfile1.str() << std::endl;
+    std::cout << outfile2.str() << std::endl;
+    return 5;
+  }
+
+  return 0;
+}
Index: tests/regression/Fragmentation/ParseSaveFragmentResults/testsuite-fragmentation-parse-save-fragment-results.at
===================================================================
--- tests/regression/Fragmentation/ParseSaveFragmentResults/testsuite-fragmentation-parse-save-fragment-results.at	(revision 9eb71b3b6836f69079f89bcc798b9c39cee638a2)
+++ tests/regression/Fragmentation/ParseSaveFragmentResults/testsuite-fragmentation-parse-save-fragment-results.at	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
@@ -31,7 +31,7 @@
 AT_CHECK([../../molecuilder --parse-fragment-results results.dat --save-fragment-results $file], 0, [ignore], [ignore])
 # we ignore white space changes (also missing new line on end of last line)
-AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
-	AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
-		AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
+AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
+	AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
+		AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
 	])
 ])
@@ -41,7 +41,7 @@
 
 AT_CHECK([../../molecuilder --parse-fragment-results $file --save-fragment-results $newfile], 0, [ignore], [ignore])
-AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
-	AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
-		AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
+AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
+	AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
+		AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
 	])
 ])
@@ -57,7 +57,7 @@
 AT_CHECK([../../molecuilder --parse-fragment-results results.dat --undo --save-fragment-results $emptyfile], 0, [ignore], [ignore])
 # we ignore white space changes (also missing new line on end of last line)
-AT_CHECK([diff -Z $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_longrange_enabled.dat], 0, [ignore], [ignore], [
-	AT_CHECK([diff -Z $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_longrange_disabled.dat], 0, [ignore], [ignore], [
-		AT_CHECK([diff -Z $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_jobmarkt_disabled.dat], 0, [ignore], [ignore])
+AT_CHECK([../../difffragmentresultcontainer $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_longrange_enabled.dat], 0, [ignore], [ignore], [
+	AT_CHECK([../../difffragmentresultcontainer $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_longrange_disabled.dat], 0, [ignore], [ignore], [
+		AT_CHECK([../../difffragmentresultcontainer $emptyfile ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_empty_jobmarkt_disabled.dat], 0, [ignore], [ignore])
 	])
 ])
@@ -73,7 +73,7 @@
 AT_CHECK([../../molecuilder --parse-fragment-results results.dat --undo --redo --save-fragment-results $file], 0, [ignore], [ignore])
 # we ignore white space changes (also missing new line on end of last line)
-AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
-	AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
-		AT_CHECK([diff -Z $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
+AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_enabled.dat], 0, [ignore], [ignore], [
+	AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_longrange_disabled.dat], 0, [ignore], [ignore], [
+		AT_CHECK([../../difffragmentresultcontainer $file ${abs_top_srcdir}/tests/regression/Fragmentation/ParseSaveFragmentResults/post/results_jobmarkt_disabled.dat], 0, [ignore], [ignore])
 	])
 ])
Index: tests/regression/Makefile.am
===================================================================
--- tests/regression/Makefile.am	(revision 9eb71b3b6836f69079f89bcc798b9c39cee638a2)
+++ tests/regression/Makefile.am	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
@@ -28,4 +28,26 @@
 
 DISTCLEANFILES = atconfig
+
+check_PROGRAMS = DiffFragmentResultContainer
+noinst_PROGRAMS = DiffFragmentResultContainer
+
+DiffFragmentResultContainer_SOURCES = \
+	DiffFragmentResultContainer.cpp
+DiffFragmentResultContainer_CPPFLAGS = \
+	-I$(top_srcdir)/src \
+	-I$(top_srcdir)/ThirdParty/LinearAlgebra/src \
+	${BOOST_CPPFLAGS} \
+	${JobMarket_CFLAGS} \
+	${CodePatterns_CFLAGS}
+DiffFragmentResultContainer_LDFLAGS = -ldl ${BOOST_LDFLAGS} ${CodePatterns_LDFLAGS} ${JobMarket_LDFLAGS}
+DiffFragmentResultContainer_LDADD = \
+	$(top_builddir)/src/libMolecuilder.la \
+	$(top_builddir)/src/libMolecuilderFragmentationSummation.la \
+	$(top_builddir)/src/libMolecuilderFragmentation_KeysetsContainer.la \
+	$(top_builddir)/src/libMolecuilderHelpers.la \
+	${CodePatterns_LIBS} \
+	$(BOOST_SERIALIZATION_LIBS) \
+	$(BOOST_FILESYSTEM_LIBS) \
+	$(BOOST_SYSTEM_LIBS)
 
 TESTSCRIPTS =
Index: tests/regression/difffragmentresultcontainer.in
===================================================================
--- tests/regression/difffragmentresultcontainer.in	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
+++ tests/regression/difffragmentresultcontainer.in	(revision 557b3979460102cb0f1b516c9366d6a163eb3620)
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# wrapper for testing with DiffFragmentResultContainer
+
+. ../../atlocal
+
+if test ! -z ${valgrind}
+then
+G_SLICE=always-malloc G_DEBUG=gc-friendly \
+libtool --mode=execute \
+${valgrind} -v \
+--log-file=valgrind.log \
+--xml=yes \
+--xml-file=valgrind.err \
+--time-stamp=yes \
+--error-exitcode=255 \
+--leak-check=full \
+--leak-resolution=high \
+--num-callers=20 \
+--track-origins=yes \
+--show-reachable=yes \
+"${topdir}/tests/regression/DiffFragmentResultContainer" \
+${1+"$@"}
+else
+"${topdir}/tests/regression/DiffFragmentResultContainer" \
+${1+"$@"}
+fi
+
+status=$?
+
+exit $status
