Index: configure.ac
===================================================================
--- configure.ac	(revision bae8b0a28256b8566e57053ad9e6fe49dd1c2b39)
+++ configure.ac	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -130,5 +130,5 @@
 BOOST_FILESYSTEM
 BOOST_PROGRAM_OPTIONS
-#BOOST_SERIALIZATION
+BOOST_SERIALIZATION
 BOOST_THREADS
 
Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision bae8b0a28256b8566e57053ad9e6fe49dd1c2b39)
+++ src/UIElements/Makefile.am	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -272,4 +272,5 @@
 	libMolecuilderRandomNumbers.la \
 	${CodePatterns_LIBS} \
+	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
 	$(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIBS) \
 	$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
Index: src/element.cpp
===================================================================
--- src/element.cpp	(revision bae8b0a28256b8566e57053ad9e6fe49dd1c2b39)
+++ src/element.cpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -205,6 +205,35 @@
 }
 
+/** Comparison operator for stub of Element.
+ *
+ * @param other other instance to compare to
+ * @return true if all member variables have the same contents.
+ */
+bool element::operator==(const element &other) const
+{
+  if (mass != other.mass) return false;
+  if (CovalentRadius != other.CovalentRadius) return false;
+  if (Electronegativity != other.Electronegativity) return false;
+  if (VanDerWaalsRadius != other.VanDerWaalsRadius) return false;
+  if (Z != other.Z) return false;
+  if (period != other.period) return false;
+  if (group != other.group) return false;
+  if (block != other.block) return false;
+  if (Valence != other.Valence) return false;
+  if (NoValenceOrbitals != other.NoValenceOrbitals) return false;
+  for (size_t i = 0; i < 3; ++i)
+    if (HBondDistance[i] != other.HBondDistance[i]) return false;
+  for (size_t i = 0; i < 3; ++i)
+    if (HBondAngle[i] != other.HBondAngle[i]) return false;
+  for (size_t i = 0; i < 3; ++i)
+    if (color[i] != other.color[i]) return false;
+  if (name != other.name) return false;
+  if (symbol != other.symbol) return false;
+  return true;
+}
+
 std::ostream &operator<<(std::ostream &ost,const element &elem){
   ost << elem.getName() << "(" << elem.getNumber() << ")";
   return ost;
 }
+
Index: src/element.hpp
===================================================================
--- src/element.hpp	(revision bae8b0a28256b8566e57053ad9e6fe49dd1c2b39)
+++ src/element.hpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -63,5 +63,33 @@
     bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
 
+    bool operator==(const element &other) const;
+
+    bool operator!=(const element &other) const {
+      return !(*this == other);
+    }
+
   private:
+    friend class boost::serialization::access;
+    // serialization
+    template<class Archive>
+    void serialize(Archive & ar, const unsigned int version)
+    {
+      ar & mass;
+      ar & CovalentRadius;
+      ar & Electronegativity;
+      ar & VanDerWaalsRadius;
+      ar & Z;
+      ar & period;
+      ar & group;
+      ar & block;
+      ar & Valence;
+      ar & NoValenceOrbitals;
+      ar & boost::serialization::make_array<double>(HBondDistance, 3);
+      ar & boost::serialization::make_array<double>(HBondAngle, 3);
+      ar & boost::serialization::make_array<unsigned char>(color, 3);
+      ar & name;
+      ar & symbol;
+    }
+
     double mass;    //!< mass in g/mol
     double CovalentRadius;  //!< covalent radius
Index: src/unittests/ElementUnitTest.cpp
===================================================================
--- src/unittests/ElementUnitTest.cpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
+++ src/unittests/ElementUnitTest.cpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -0,0 +1,170 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementUnitTest.cpp
+ *
+ *  Created on: Oct 29, 2009
+ *      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 <sstream>
+
+#include "element.hpp"
+
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include "ElementUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ElementTest );
+
+
+void ElementTest::setUp()
+{
+  testelement = new element();
+  testelement->setSymbol("H");
+};
+
+
+void ElementTest::tearDown()
+{
+  delete testelement;
+};
+
+/** Test whether assignment works
+ *
+ */
+void ElementTest::AssignmentTest()
+{
+  element * otherelement = new element();
+  element * const backup = otherelement;
+  CPPUNIT_ASSERT( otherelement != testelement );
+  otherelement = testelement;
+  CPPUNIT_ASSERT( otherelement == testelement );
+  otherelement = backup;
+  *otherelement = *testelement;
+  CPPUNIT_ASSERT( *otherelement == *testelement );
+  delete backup;
+
+  otherelement = new element(*testelement);
+  CPPUNIT_ASSERT( otherelement != testelement );
+  CPPUNIT_ASSERT( *otherelement == *testelement );
+  delete otherelement;
+}
+
+/** Test whether the getters are working.
+ *
+ */
+void ElementTest::GetterTest()
+{
+  CPPUNIT_ASSERT_EQUAL( (atomId_t)0, testelement->getNumber() );
+  CPPUNIT_ASSERT_EQUAL( 0., testelement->getMass() );
+  const unsigned char * color = testelement->getColor();
+  for (size_t i = 0; i < 3; ++i)
+    CPPUNIT_ASSERT_EQUAL( (unsigned char)0, color[i] );
+  CPPUNIT_ASSERT_EQUAL( 0., testelement->getCovalentRadius() );
+  CPPUNIT_ASSERT_EQUAL( 0., testelement->getElectronegativity() );
+  CPPUNIT_ASSERT_EQUAL( 0., testelement->getVanDerWaalsRadius() );
+  CPPUNIT_ASSERT_EQUAL( 0, testelement->getAtomicNumber() );
+  CPPUNIT_ASSERT_EQUAL( 0., testelement->getValence() );
+  CPPUNIT_ASSERT_EQUAL( 0, testelement->getNoValenceOrbitals() );
+  CPPUNIT_ASSERT_EQUAL( 0, testelement->getNoValenceOrbitals() );
+  for (size_t i = 0; i < 3; ++i)
+    CPPUNIT_ASSERT_EQUAL( 0., testelement->getHBondDistance(i) );
+  for (size_t i = 0; i < 3; ++i)
+    CPPUNIT_ASSERT_EQUAL( 0., testelement->getHBondAngle(i) );
+}
+
+/** Test whether the setters are working.
+ *
+ */
+void ElementTest::SetterTest()
+{
+  // symbol
+  CPPUNIT_ASSERT( testelement->getSymbol() != std::string("He") );
+  testelement->setSymbol("He");
+  CPPUNIT_ASSERT_EQUAL( std::string("He"), testelement->getSymbol() );
+
+  // name
+  CPPUNIT_ASSERT( testelement->getName() != std::string("Helium") );
+  testelement->setName("Helium");
+  CPPUNIT_ASSERT_EQUAL( std::string("Helium"), testelement->getName() );
+}
+
+/** Unit test for operator==()
+ */
+void ElementTest::ComparisonTest()
+{
+  testelement->setSymbol("He");
+  testelement->setName("Helium");
+  element * newelement = new element();
+  newelement->setSymbol("H");
+  newelement->setName("Hydrogen");
+
+  CPPUNIT_ASSERT( *testelement != *newelement );
+
+  newelement->setSymbol("He");
+  newelement->setName("Helium");
+
+  CPPUNIT_ASSERT( *testelement == *newelement );
+
+  delete newelement;
+}
+
+/** Tests whether serialization of the class works
+ */
+void ElementTest::SerializeTest()
+{
+  const std::string he("He");
+  const std::string helium("Helium");
+  testelement->setSymbol(he);
+  testelement->setName(helium);
+
+  CPPUNIT_ASSERT_EQUAL ( he, testelement->getSymbol() );
+  CPPUNIT_ASSERT_EQUAL( helium, testelement->getName() );
+
+  // write element to stream
+  std::stringstream stream;
+  boost::archive::text_oarchive oa(stream);
+  oa << testelement;
+
+  std::cout << "Contents of archive is " << stream.str() << std::endl;
+
+  // create and open an archive for input
+  boost::archive::text_iarchive ia(stream);
+  // read class state from archive
+  element * newelement;
+
+  ia >> newelement;
+
+  CPPUNIT_ASSERT_EQUAL( he, newelement->getSymbol() );
+  CPPUNIT_ASSERT_EQUAL( helium, newelement->getName() );
+
+  CPPUNIT_ASSERT (*testelement == *newelement);
+
+  delete newelement;
+};
Index: src/unittests/ElementUnitTest.hpp
===================================================================
--- src/unittests/ElementUnitTest.hpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
+++ src/unittests/ElementUnitTest.hpp	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -0,0 +1,47 @@
+/*
+ * ElementUnitTest.hpp
+ *
+ *  Created on: Oct 29, 2009
+ *      Author: heber
+ */
+
+#ifndef ELEMENTUNITTEST_HPP_
+#define ELEMENTUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+class element;
+
+/********************************************** Test classes **************************************/
+
+class ElementTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( ElementTest) ;
+    CPPUNIT_TEST ( SetterTest );
+    CPPUNIT_TEST ( GetterTest );
+    CPPUNIT_TEST ( ComparisonTest );
+    CPPUNIT_TEST ( AssignmentTest );
+    CPPUNIT_TEST ( SerializeTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void AssignmentTest();
+      void GetterTest();
+      void SetterTest();
+      void ComparisonTest();
+      void SerializeTest();
+
+private:
+      element *testelement;
+};
+
+#endif /* ELEMENTUNITTEST_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision bae8b0a28256b8566e57053ad9e6fe49dd1c2b39)
+++ src/unittests/Makefile.am	(revision d7d0227486bc1c19c9648ca87b259ad4cf6fa8c2)
@@ -27,4 +27,5 @@
   BoxUnitTest \
   CountBondsUnitTest \
+  ElementUnitTest \
   FormulaUnittest \
   LinkedCellUnitTest \
@@ -45,5 +46,6 @@
 BOOST_LIB = \
 	$(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIBS) \
-	$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS)
+	$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
+	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS)
 
 ALLLIBS = \
@@ -70,4 +72,5 @@
   BoxUnitTest.cpp \
   CountBondsUnitTest.cpp \
+  ElementUnitTest.cpp \
   FormulaUnitTest.cpp \
   LinkedCellUnitTest.cpp \
@@ -95,4 +98,5 @@
   BoxUnitTest.hpp \
   CountBondsUnitTest.hpp \
+  ElementUnitTest.hpp \
   FormulaUnitTest.hpp \
   LinkedCellUnitTest.hpp \
@@ -140,4 +144,12 @@
 CountBondsUnitTest_LDADD = ${ALLLIBS}
 
+ElementUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	ElementUnitTest.cpp \
+	../element.cpp \
+	ElementUnitTest.hpp \
+	../element.hpp
+ElementUnitTest_LDADD = \
+	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS)
+
 FormulaUnittest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
 	FormulaUnitTest.cpp \
