diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index f2a8302..eead545 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -84,32 +84,36 @@
   return adj;
 }
 
-static bool
-compareAdjacent(const Adjacent& adjacent1, const Adjacent& adjacent2)
-{
-  return adjacent1.getName() < adjacent2.getName();
-}
-
 bool
-AdjacencyList::operator==(AdjacencyList& adl)
+AdjacencyList::operator==(AdjacencyList& adl) const
 {
-  if (getSize() != adl.getSize()) {
+  if (m_adjList.size() != adl.getSize()) {
     return false;
   }
-  m_adjList.sort(compareAdjacent);
-  adl.getAdjList().sort(compareAdjacent);
-  uint32_t equalAdjCount = 0;
-  std::list<Adjacent>& adjList2 = adl.getAdjList();
-  std::list<Adjacent>::iterator it1;
-  std::list<Adjacent>::iterator it2;
-  for (it1 = m_adjList.begin(), it2 = adjList2.begin();
-       it1 != m_adjList.end(); it1++, it2++) {
-    if (!((*it1) == (*it2))) {
-      break;
+
+  auto comparator =
+    [] (const Adjacent* lhs, const Adjacent* rhs) {
+      return *lhs < *rhs;
+  };
+
+  std::vector<const Adjacent*> ourList;
+  std::transform(m_adjList.begin(), m_adjList.end(),
+                 std::back_inserter(ourList), std::pointer_traits<const Adjacent*>::pointer_to);
+
+  std::vector<const Adjacent*> theirList;
+  std::transform(adl.getAdjList().begin(), adl.getAdjList().end(),
+                 std::back_inserter(theirList), std::pointer_traits<const Adjacent*>::pointer_to);
+
+  std::sort(ourList.begin(), ourList.end(), std::bind(comparator, _1, _2));
+  std::sort(theirList.begin(), theirList.end(), std::bind(comparator, _1, _2));
+
+  for (size_t i = 0; i < ourList.size(); i++) {
+    if (*(ourList[i]) != *(theirList[i])) {
+      std::cout << *ourList[i] << ":" << *theirList[i];
+      return false;
     }
-    equalAdjCount++;
   }
-  return equalAdjCount == getSize();
+  return true;
 }
 
 int32_t
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 66a2710..5ed5012 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -126,7 +126,7 @@
   getAdjacent(const ndn::Name& adjName);
 
   bool
-  operator==(AdjacencyList& adl);
+  operator==(AdjacencyList& adl) const;
 
   size_t
   getSize()
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 78c71b5..7109f21 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -72,14 +72,26 @@
           std::numeric_limits<double>::epsilon());
 }
 
+bool
+Adjacent::operator<(const Adjacent& adjacent) const
+{
+  return (m_name < adjacent.getName()) ||
+         (m_linkCost < adjacent.getLinkCost());
+}
+
+std::ostream&
+operator<<(std::ostream& os, const Adjacent& adjacent)
+{
+  os << "Adjacent: " << adjacent.m_name << "\n Connecting FaceUri: " << adjacent.m_faceUri
+     << "\n Link cost: " << adjacent.m_linkCost << "\n Status: " << adjacent.m_status
+     << "\n Interest Timed Out: " << adjacent.m_interestTimedOutNo << std::endl;
+  return os;
+}
+
 void
 Adjacent::writeLog()
 {
-  _LOG_DEBUG("Adjacent : " << m_name);
-  _LOG_DEBUG("Connecting FaceUri: " << m_faceUri);
-  _LOG_DEBUG("Link Cost: " << m_linkCost);
-  _LOG_DEBUG("Status: " << m_status);
-  _LOG_DEBUG("Interest Timed out: " << m_interestTimedOutNo);
+  _LOG_DEBUG(*this);
 }
 
 } // namespace nlsr
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 499e45e..dcdefc8 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -130,6 +130,15 @@
   bool
   operator==(const Adjacent& adjacent) const;
 
+  bool
+  operator!=(const Adjacent& adjacent) const
+  {
+    return !(*this == adjacent);
+  }
+
+  bool
+  operator<(const Adjacent& adjacent) const;
+
   inline bool
   compare(const ndn::Name& adjacencyName)
   {
@@ -168,8 +177,14 @@
   /*! m_faceId The NFD-assigned ID for the neighbor, used to
    * determine whether a Face is available */
   uint64_t m_faceId;
+
+  friend std::ostream&
+  operator<<(std::ostream& os, const Adjacent& adjacent);
 };
 
+std::ostream&
+operator<<(std::ostream& os, const Adjacent& adjacent);
+
 } // namespace nlsr
 
 #endif // NLSR_ADJACENT_HPP
diff --git a/tests/test-adjacent.cpp b/tests/test-adjacent.cpp
index e494682..8bd0c26 100644
--- a/tests/test-adjacent.cpp
+++ b/tests/test-adjacent.cpp
@@ -46,6 +46,25 @@
   BOOST_CHECK(adjacent1 == adjacent2);
 }
 
+BOOST_AUTO_TEST_CASE(OperatorLessThan)
+{
+  const ndn::Name ADJ_NAME_1 = "name1";
+  const double ADJ_LINK_COST_1 = 1;
+  const ndn::Name ADJ_NAME_2 = "name2";
+  const double ADJ_LINK_COST_2 = 2;
+  Adjacent adjacent1(ADJ_NAME_1);
+  Adjacent adjacent2(ADJ_NAME_1);
+  adjacent1.setLinkCost(ADJ_LINK_COST_1);
+  adjacent2.setLinkCost(ADJ_LINK_COST_2);
+
+  BOOST_CHECK(adjacent1 < adjacent2);
+
+  Adjacent adjacent3(ADJ_NAME_2);
+  adjacent3.setLinkCost(ADJ_LINK_COST_1);
+
+  BOOST_CHECK(adjacent1 < adjacent3);
+}
+
 BOOST_AUTO_TEST_CASE(Accessors)
 {
   const ndn::Name ADJ_NAME_1 = "name1";
