diff --git a/tests/unit-tests/test-interest-table.cpp b/tests/unit-tests/test-interest-table.cpp
new file mode 100644
index 0000000..3a312d4
--- /dev/null
+++ b/tests/unit-tests/test-interest-table.cpp
@@ -0,0 +1,177 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2014 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync 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 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync 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
+ * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "interest-table.hpp"
+
+#include <ndn-cxx/util/scheduler.hpp>
+#include <unistd.h>
+
+#include "boost-test.hpp"
+
+namespace chronosync {
+namespace test {
+
+class InterestTableFixture
+{
+public:
+  InterestTableFixture()
+    : scheduler(io)
+  {
+    uint8_t origin[4] = {0x01, 0x02, 0x03, 0x04};
+    Name prefix("/test/prefix");
+
+    Name interestName1;
+    digest1 = ndn::crypto::sha256(origin, 1);
+    interestName1.append(prefix).append(name::Component(digest1));
+    interest1 = make_shared<Interest>(interestName1);
+    interest1->setInterestLifetime(time::milliseconds(100));
+
+    Name interestName2;
+    digest2 = ndn::crypto::sha256(origin, 2);
+    interestName2.append(prefix).append(name::Component(digest2));
+    interest2 = make_shared<Interest>(interestName2);
+    interest2->setInterestLifetime(time::milliseconds(100));
+
+    Name interestName3;
+    digest3 = ndn::crypto::sha256(origin, 3);
+    interestName3.append(prefix).append(name::Component(digest3));
+    interest3 = make_shared<Interest>(interestName3);
+    interest3->setInterestLifetime(time::milliseconds(100));
+  }
+
+  void
+  insert(InterestTable& table,
+         shared_ptr<Interest> interest,
+         ndn::ConstBufferPtr digest)
+  {
+    table.insert(interest, digest);
+  }
+
+  void
+  check(InterestTable& table, size_t size)
+  {
+    BOOST_CHECK_EQUAL(table.size(), size);
+  }
+
+  void
+  terminate()
+  {
+    io.stop();
+  }
+
+  shared_ptr<Interest> interest1;
+  ndn::ConstBufferPtr digest1;
+
+  shared_ptr<Interest> interest2;
+  ndn::ConstBufferPtr digest2;
+
+  shared_ptr<Interest> interest3;
+  ndn::ConstBufferPtr digest3;
+
+  boost::asio::io_service io;
+  ndn::Scheduler scheduler;
+};
+
+BOOST_FIXTURE_TEST_SUITE(InterestTableTest, InterestTableFixture)
+
+BOOST_AUTO_TEST_CASE(Container)
+{
+  InterestContainer container;
+
+  container.insert(boost::make_shared<UnsatisfiedInterest>(interest1, digest1));
+  container.insert(boost::make_shared<UnsatisfiedInterest>(interest2, digest2));
+  container.insert(boost::make_shared<UnsatisfiedInterest>(interest3, digest3));
+
+  BOOST_CHECK_EQUAL(container.size(), 3);
+  BOOST_CHECK(container.find(digest3) != container.end());
+  BOOST_CHECK(container.find(digest2) != container.end());
+  BOOST_CHECK(container.find(digest1) != container.end());
+}
+
+BOOST_AUTO_TEST_CASE(Basic)
+{
+  InterestTable table(io);
+
+  table.insert(interest1, digest1);
+  table.insert(interest2, digest2);
+  table.insert(interest3, digest3);
+
+  BOOST_CHECK_EQUAL(table.size(), 3);
+  InterestTable::const_iterator it = table.begin();
+  BOOST_CHECK(it != table.end());
+  it++;
+  BOOST_CHECK(it != table.end());
+  it++;
+  BOOST_CHECK(it != table.end());
+  it++;
+  BOOST_CHECK(it == table.end());
+
+  BOOST_CHECK_EQUAL(table.size(), 3);
+  table.erase(digest1);
+  BOOST_CHECK_EQUAL(table.size(), 2);
+  table.erase(digest2);
+  BOOST_CHECK_EQUAL(table.size(), 1);
+  ConstUnsatisfiedInterestPtr pendingInterest = *table.begin();
+  table.clear();
+  BOOST_CHECK_EQUAL(table.size(), 0);
+  BOOST_CHECK(*pendingInterest->digest == *digest3);
+}
+
+BOOST_AUTO_TEST_CASE(Expire)
+{
+  InterestTable table(io);
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(50),
+                          ndn::bind(&InterestTableFixture::insert, this,
+                                    boost::ref(table), interest1, digest1));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(150),
+                          ndn::bind(&InterestTableFixture::insert, this,
+                                    boost::ref(table), interest2, digest2));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(150),
+                          ndn::bind(&InterestTableFixture::insert, this,
+                                    boost::ref(table), interest3, digest3));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(200),
+                          ndn::bind(&InterestTableFixture::insert, this,
+                                    boost::ref(table), interest2, digest2));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(220),
+                          ndn::bind(&InterestTableFixture::check, this,
+                                    boost::ref(table), 2));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(270),
+                          ndn::bind(&InterestTableFixture::check, this,
+                                    boost::ref(table), 1));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(420),
+                          ndn::bind(&InterestTableFixture::check, this,
+                                    boost::ref(table), 0));
+
+  scheduler.scheduleEvent(ndn::time::milliseconds(500),
+                          ndn::bind(&InterestTableFixture::terminate, this));
+
+  io.run();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace chronosync
diff --git a/tests/unit-tests/test-interest-table.cpp.outdated b/tests/unit-tests/test-interest-table.cpp.outdated
deleted file mode 100644
index 2db3eed..0000000
--- a/tests/unit-tests/test-interest-table.cpp.outdated
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012-2014 University of California, Los Angeles
- *
- * This file is part of ChronoSync, synchronization library for distributed realtime
- * applications for NDN.
- *
- * ChronoSync 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 3 of the License, or (at your option) any later version.
- *
- * ChronoSync 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
- * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <boost/test/unit_test.hpp>
-#include <boost/test/output_test_stream.hpp>
-#include <map>
-using boost::test_tools::output_test_stream;
-
-#include <boost/make_shared.hpp>
-
-#include "sync-interest-table.h"
-
-using namespace Sync;
-using namespace std;
-using namespace boost;
-
-BOOST_AUTO_TEST_CASE (InterestTableTest)
-{
-  // Alex: test is broken due to changes in SyncInterestTable
-  // cerr << "InterestTableTest is broken" << endl;
-
-  // SyncInterestTable *table = 0;
-  // BOOST_CHECK_NO_THROW (table = new SyncInterestTable ());
-
-  // BOOST_CHECK_NO_THROW (delete table);
-}
diff --git a/tests/unit-tests/test-pit.cpp.outdated b/tests/unit-tests/test-pit.cpp.outdated
deleted file mode 100644
index 39b36b9..0000000
--- a/tests/unit-tests/test-pit.cpp.outdated
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012-2014 University of California, Los Angeles
- *
- * This file is part of ChronoSync, synchronization library for distributed realtime
- * applications for NDN.
- *
- * ChronoSync 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 3 of the License, or (at your option) any later version.
- *
- * ChronoSync 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
- * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <boost/test/unit_test.hpp>
-#include <boost/test/output_test_stream.hpp>
-using boost::test_tools::output_test_stream;
-#include <vector>
-
-#include <boost/make_shared.hpp>
-
-#include "sync-interest-table.h"
-#include "sync-logging.h"
-
-using namespace Sync;
-using namespace std;
-using namespace boost;
-
-// string sitToString(SyncInterestTable *sit) {
-//   vector<string> ent = sit->fetchAll();
-//   sort(ent.begin(), ent.end());
-//   string str = "";
-//   while(!ent.empty()){
-//     str += ent.back();
-//     ent.pop_back();
-//   }
-//   return str;
-// }
-
-BOOST_AUTO_TEST_CASE (SyncInterestTableTest)
-{
-  cerr << "SyncInterestTableTest is broken" << endl;
-
-  // INIT_LOGGERS ();
-  // INIT_LOGGER ("Test.Pit");
-
-  // SyncInterestTable sit;
-  // sit.insert("/ucla.edu/0");
-  // sit.insert("/ucla.edu/1");
-  // string str = sitToString(&sit);
-  // BOOST_CHECK_EQUAL(str, "/ucla.edu/1/ucla.edu/0");
-
-  // str = sitToString(&sit);
-  // BOOST_CHECK_EQUAL(str, "");
-
-  // _LOG_DEBUG ("Adding 0 and 1");
-  // sit.insert("/ucla.edu/0");
-  // sit.insert("/ucla.edu/1");
-  // sleep(2);
-  // _LOG_DEBUG ("Adding 0 and 2");
-  // sit.insert("/ucla.edu/0");
-  // sit.insert("/ucla.edu/2");
-  // sleep(3);
-  // _LOG_DEBUG ("Checking");
-  // str = sitToString(&sit);
-  // BOOST_CHECK_EQUAL(str, "/ucla.edu/2/ucla.edu/0");
-}
