Index: src/Filling/Makefile.am
===================================================================
--- src/Filling/Makefile.am	(revision b00ab1b88d1ad76942e82e3eece9355ea217a2d7)
+++ src/Filling/Makefile.am	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -4,5 +4,6 @@
 FILLINGSOURCE = \
 	Filling/Predicates/AnyFillPredicate.cpp \
-	Filling/Predicates/FillPredicate.cpp
+	Filling/Predicates/FillPredicate.cpp \
+	Filling/Predicates/IsValidInDomain_FillPredicate.cpp
 	
 FILLINGHEADER = \
@@ -11,5 +12,6 @@
 	Filling/Predicates/FillPredicate.hpp \
 	Filling/Predicates/FillPredicateBase.hpp \
-	Filling/Predicates/FillPredicate_impl.hpp
+	Filling/Predicates/FillPredicate_impl.hpp \
+	Filling/Predicates/IsValidInDomain_FillPredicate.hpp
 
 
Index: src/Filling/Predicates/IsValidInDomain_FillPredicate.cpp
===================================================================
--- src/Filling/Predicates/IsValidInDomain_FillPredicate.cpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
+++ src/Filling/Predicates/IsValidInDomain_FillPredicate.cpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IsValidInDomain_FillPredicate.cpp
+ *
+ *  Created on: Jan 16, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/bind.hpp>
+
+#include "IsValidInDomain_FillPredicate.hpp"
+
+#include "AnyFillPredicate.hpp"
+#include "Box.hpp"
+#include "FillPredicate.hpp"
+
+
+FillPredicate IsValidInDomain_FillPredicate(const Box &domain)
+{
+  AnyFillPredicate::FillPredicator function = boost::bind(&Box::isValid, &domain, _1);
+  FillPredicate::impl_ptr impl(new AnyFillPredicate(function));
+  return FillPredicate(impl);
+}
Index: src/Filling/Predicates/IsValidInDomain_FillPredicate.hpp
===================================================================
--- src/Filling/Predicates/IsValidInDomain_FillPredicate.hpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
+++ src/Filling/Predicates/IsValidInDomain_FillPredicate.hpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -0,0 +1,22 @@
+/*
+ * IsValidInDomain_FillPredicate.hpp
+ *
+ *  Created on: Jan 16, 2012
+ *      Author: heber
+ */
+
+#ifndef ISVALIDINDOMAIN_FILLPREDICATE_HPP_
+#define ISVALIDINDOMAIN_FILLPREDICATE_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "FillPredicate.hpp"
+
+class Box;
+
+FillPredicate IsValidInDomain_FillPredicate(const Box &domain);
+
+#endif /* ISVALIDINDOMAIN_FILLPREDICATE_HPP_ */
Index: src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp
===================================================================
--- src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
+++ src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -0,0 +1,126 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IsValidInDomain_FillPredicateUnitTest.cpp
+ *
+ *  Created on: Jan 18, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Box.hpp"
+#include "Filling/Predicates/IsValidInDomain_FillPredicate.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+#include "Filling/NodeTypes.hpp"
+
+#include "IsValidInDomain_FillPredicateUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( IsValidInDomain_FillPredicateTest );
+
+
+void IsValidInDomain_FillPredicateTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  M = new RealSpaceMatrix;
+  M->setIdentity();
+  (*M) *= 20.;
+
+  domain = new Box(*M);
+
+  predicate = new FillPredicate(IsValidInDomain_FillPredicate(*domain));
+}
+
+
+void IsValidInDomain_FillPredicateTest::tearDown()
+{
+  delete predicate;
+  delete domain;
+  delete M;
+}
+
+/** Test whether operator() returns as desired
+ *
+ */
+void IsValidInDomain_FillPredicateTest::operatorTest()
+{
+  Node origin(0.,0.,0.);
+  Node center(10.,10.,10.);
+  Node corner(20.,20.,20.);
+  Node outside(30.,30.,30.);
+
+  for (size_t i=0;i<NDIM;++i)
+    domain->setCondition(i, BoundaryConditions::Wrap);
+
+  // boundary conditions: Wrap
+  {
+    // origin is inside
+    CPPUNIT_ASSERT( (*predicate)(origin) );
+
+    // center is inside
+    CPPUNIT_ASSERT( (*predicate)(center) );
+
+    // corner is inside
+    CPPUNIT_ASSERT( (*predicate)(corner) );
+
+    // outside is outside
+    CPPUNIT_ASSERT( (*predicate)(outside) );
+  }
+
+  // boundary conditions: Bounce
+  {
+    domain->setCondition(0, BoundaryConditions::Bounce);
+    // origin is inside
+    CPPUNIT_ASSERT( (*predicate)(origin) );
+
+    // center is inside
+    CPPUNIT_ASSERT( (*predicate)(center) );
+
+    // corner is inside
+    CPPUNIT_ASSERT( (*predicate)(corner) );
+
+    // outside is outside
+    CPPUNIT_ASSERT( (*predicate)(outside) );
+    domain->setCondition(0, BoundaryConditions::Wrap);
+  }
+
+  // boundary conditions: Ignore
+  {
+    domain->setCondition(0, BoundaryConditions::Ignore);
+    // origin is inside
+    CPPUNIT_ASSERT( (*predicate)(origin) );
+
+    // center is inside
+    CPPUNIT_ASSERT( (*predicate)(center) );
+
+    // corner is inside
+    CPPUNIT_ASSERT( (*predicate)(corner) );
+
+    // outside is outside
+    CPPUNIT_ASSERT( !(*predicate)(outside) );
+    domain->setCondition(0, BoundaryConditions::Wrap);
+  }
+}
Index: src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp
===================================================================
--- src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
+++ src/Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -0,0 +1,42 @@
+/*
+ * IsValidInDomain_FillPredicateUnitTest.hpp
+ *
+ *  Created on: Jan 18, 2012
+ *      Author: heber
+ */
+
+#ifndef ISVALIDINDOMAIN_FILLPREDICATEUNITTEST_HPP_
+#define ISVALIDINDOMAIN_FILLPREDICATEUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class Box;
+class RealSpaceMatrix;
+class FillPredicate;
+
+/********************************************** Test classes **************************************/
+
+class IsValidInDomain_FillPredicateTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( IsValidInDomain_FillPredicateTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+
+private:
+      RealSpaceMatrix *M;
+      Box *domain;
+      FillPredicate *predicate;
+};
+
+#endif /* ISVALIDINDOMAIN_FILLPREDICATEUNITTEST_HPP_ */
Index: src/Filling/unittests/Makefile.am
===================================================================
--- src/Filling/unittests/Makefile.am	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
+++ src/Filling/unittests/Makefile.am	(revision 600a5296c7fb2bdb5ffe9f184edc5632d2acb442)
@@ -0,0 +1,31 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+FILLINGTESTSSOURCES = \
+  ../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp
+
+FILLINGTESTSHEADERS = \
+  ../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp
+
+FILLINGTESTS = \
+  IsValidInDomain_FillPredicateUnitTest
+
+TESTS += $(FILLINGTESTS)
+check_PROGRAMS += $(FILLINGTESTS) 
+noinst_PROGRAMS += $(FILLINGTESTS)
+
+FILLINGLIBS =
+
+IsValidInDomain_FillPredicateUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp \
+	../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp
+IsValidInDomain_FillPredicateUnitTest_LDADD = \
+	../libMolecuilderFilling.la \
+	../libMolecuilderUI.la \
+	../libMolecuilder.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
+	${CodePatterns_LIBS} \
+	$(BOOST_LIBS)
+
+
+#AUTOMAKE_OPTIONS = parallel-tests
