diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp
index eba000d..30ffa7c 100644
--- a/tests/publisher/publisher-fixture.hpp
+++ b/tests/publisher/publisher-fixture.hpp
@@ -84,7 +84,7 @@
   }
 
   CoordinateLsa
-  createCoordinateLsa(const std::string& origin, double radius, double angle)
+  createCoordinateLsa(const std::string& origin, double radius, std::vector<double> angle)
   {
     CoordinateLsa lsa(origin, 1, ndn::time::system_clock::now(),
                       radius, angle);
@@ -109,7 +109,7 @@
     checkTlvLsaInfo(tlvLsa.getLsaInfo(), lsa);
 
     BOOST_CHECK_EQUAL(tlvLsa.getHyperbolicRadius(), lsa.getCorRadius());
-    BOOST_CHECK_EQUAL(tlvLsa.getHyperbolicAngle(), lsa.getCorTheta());
+    BOOST_CHECK(tlvLsa.getHyperbolicAngle() == lsa.getCorTheta());
   }
 
   void
diff --git a/tests/publisher/test-lsa-publisher.cpp b/tests/publisher/test-lsa-publisher.cpp
index 8ee842b..6a3045f 100644
--- a/tests/publisher/test-lsa-publisher.cpp
+++ b/tests/publisher/test-lsa-publisher.cpp
@@ -76,13 +76,20 @@
 {
   ndn::Name thisRouter("/RouterA");
 
-  CoordinateLsa routerALsa = createCoordinateLsa(thisRouter.toUri(), 10.0, 20.0);
+  std::vector<double> anglesA, anglesB, anglesC;
+  anglesA.push_back(20.00);
+  anglesB.push_back(543.21);
+  // Setting two angles for testing routerCLsa
+  anglesC.push_back(0.02);
+  anglesC.push_back(1.23);
+
+  CoordinateLsa routerALsa = createCoordinateLsa(thisRouter.toUri(), 10.0, anglesA);
   lsdb.installCoordinateLsa(routerALsa);
 
-  CoordinateLsa routerBLsa = createCoordinateLsa("/RouterB", 123.45, 543.21);
+  CoordinateLsa routerBLsa = createCoordinateLsa("/RouterB", 123.45, anglesB);
   lsdb.installCoordinateLsa(routerBLsa);
 
-  CoordinateLsa routerCLsa = createCoordinateLsa("/RouterC", 0.01, 0.02);
+  CoordinateLsa routerCLsa = createCoordinateLsa("/RouterC", 0.01, anglesC);
   lsdb.installCoordinateLsa(routerCLsa);
 
   CoordinateLsaPublisher publisher(lsdb, *face, keyChain);
diff --git a/tests/publisher/test-lsdb-dataset-interest-handler.cpp b/tests/publisher/test-lsdb-dataset-interest-handler.cpp
index 8e9855a..e08d1f2 100644
--- a/tests/publisher/test-lsdb-dataset-interest-handler.cpp
+++ b/tests/publisher/test-lsdb-dataset-interest-handler.cpp
@@ -70,8 +70,10 @@
   addAdjacency(adjLsa, "/RouterA/adjacency1", "udp://face-1", 10);
   lsdb.installAdjLsa(adjLsa);
 
+  std::vector<double> angles = {20.00, 30.00};
+
   // Install coordinate LSA
-  CoordinateLsa coordinateLsa = createCoordinateLsa("/RouterA", 10.0, 20.0);
+  CoordinateLsa coordinateLsa = createCoordinateLsa("/RouterA", 10.0, angles);
   lsdb.installCoordinateLsa(coordinateLsa);
 
   // Install Name LSA
diff --git a/tests/publisher/test-lsdb-status-publisher.cpp b/tests/publisher/test-lsdb-status-publisher.cpp
index be21670..c9412ad 100644
--- a/tests/publisher/test-lsdb-status-publisher.cpp
+++ b/tests/publisher/test-lsdb-status-publisher.cpp
@@ -49,14 +49,18 @@
   addAdjacency(routerBAdjLsa, "/RouterB/adjacency3", "udp://face-3", 30);
   lsdb.installAdjLsa(routerBAdjLsa);
 
+  std::vector<double> anglesA = {20.00},
+                      anglesB = {543.21},
+                      anglesC = {0.02, 2.25};
+
   // Install coordinate LSAs
-  CoordinateLsa routerACorLsa = createCoordinateLsa("/RouterA", 10.0, 20.0);
+  CoordinateLsa routerACorLsa = createCoordinateLsa("/RouterA", 10.0, anglesA);
   lsdb.installCoordinateLsa(routerACorLsa);
 
-  CoordinateLsa routerBCorLsa = createCoordinateLsa("/RouterB", 123.45, 543.21);
+  CoordinateLsa routerBCorLsa = createCoordinateLsa("/RouterB", 123.45, anglesB);
   lsdb.installCoordinateLsa(routerBCorLsa);
 
-  CoordinateLsa routerCCorLsa = createCoordinateLsa("/RouterC", 0.01, 0.02);
+  CoordinateLsa routerCCorLsa = createCoordinateLsa("/RouterC", 0.01, anglesC);
   lsdb.installCoordinateLsa(routerCCorLsa);
 
   // Install Name LSAs
diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp
index e818ac3..df347f1 100644
--- a/tests/test-conf-file-processor.cpp
+++ b/tests/test-conf-file-processor.cpp
@@ -98,6 +98,14 @@
   "  angle    1.45\n"
   "}\n\n";
 
+const std::string SECTION_HYPERBOLIC_ANGLES_ON =
+    "hyperbolic\n"
+    "{\n"
+    "  state on\n"
+    "  radius   123.456\n"
+    "  angle    1.45,2.25\n"
+    "}\n\n";
+
 const std::string SECTION_HYPERBOLIC_OFF =
   "hyperbolic\n"
   "{\n"
@@ -128,6 +136,10 @@
 const std::string CONFIG_HYPERBOLIC = SECTION_GENERAL + SECTION_NEIGHBORS +
                                       SECTION_HYPERBOLIC_ON + SECTION_FIB + SECTION_ADVERTISING;
 
+const std::string CONFIG_HYPERBOLIC_ANGLES = SECTION_GENERAL + SECTION_NEIGHBORS +
+                                             SECTION_HYPERBOLIC_ANGLES_ON + SECTION_FIB +
+                                             SECTION_ADVERTISING;
+
 class ConfFileProcessorFixture : public BaseFixture
 {
 public:
@@ -365,7 +377,22 @@
   ConfParameter& conf = nlsr.getConfParameter();
   BOOST_CHECK_EQUAL(conf.getHyperbolicState(), 1);
   BOOST_CHECK_EQUAL(conf.getCorR(), 123.456);
-  BOOST_CHECK_EQUAL(conf.getCorTheta(), 1.45);
+  std::vector<double> angles;
+  angles.push_back(1.45);
+  BOOST_CHECK(conf.getCorTheta() == angles);
+}
+
+BOOST_AUTO_TEST_CASE(Hyperbolic2)
+{
+  processConfigurationString(CONFIG_HYPERBOLIC_ANGLES);
+
+  ConfParameter& conf = nlsr.getConfParameter();
+  BOOST_CHECK_EQUAL(conf.getHyperbolicState(), 1);
+  BOOST_CHECK_EQUAL(conf.getCorR(), 123.456);
+  std::vector<double> angles;
+  angles.push_back(1.45);
+  angles.push_back(2.25);
+  BOOST_CHECK(conf.getCorTheta() == angles);
 }
 
 BOOST_AUTO_TEST_CASE(DefaultValuesGeneral)
diff --git a/tests/test-conf-parameter.cpp b/tests/test-conf-parameter.cpp
index 2d69a27..55a65b1 100644
--- a/tests/test-conf-parameter.cpp
+++ b/tests/test-conf-parameter.cpp
@@ -61,7 +61,9 @@
 
   cp1.setCorR(2.5);
 
-  cp1.setCorTheta(102.5);
+  std::vector<double> angles = {102.5};
+
+  cp1.setCorTheta(angles);
 
   cp1.setInfoInterestInterval(3);
 
@@ -89,7 +91,7 @@
 
   BOOST_CHECK_EQUAL(cp1.getHyperbolicState(), 1);
 
-  BOOST_CHECK_CLOSE(cp1.getCorTheta(), 102.5, 0.0001);
+  BOOST_CHECK(cp1.getCorTheta() == angles);
 
   BOOST_CHECK_EQUAL(cp1.getInfoInterestInterval(), 3);
 }
diff --git a/tests/test-hyperbolic-calculator.cpp b/tests/test-hyperbolic-calculator.cpp
index 0001ae4..030fe25 100644
--- a/tests/test-hyperbolic-calculator.cpp
+++ b/tests/test-hyperbolic-calculator.cpp
@@ -51,11 +51,11 @@
     , adjacencies(nlsr.getAdjacencyList())
     , lsdb(nlsr.getLsdb())
   {
-    setUpTopology();
   }
 
   // Triangle topology with routers A, B, C connected
-  void setUpTopology()
+  void setUpTopology(std::vector<double> anglesA, std::vector<double> anglesB,
+                     std::vector<double> anglesC)
   {
     INIT_LOGGERS("/tmp", "TRACE");
 
@@ -70,7 +70,8 @@
     AdjLsa adjA(a.getName(), 1, MAX_TIME, 2, adjacencies);
     lsdb.installAdjLsa(adjA);
 
-    CoordinateLsa coordA(adjA.getOrigRouter(), 1, MAX_TIME, 16.23, 2.97);
+
+    CoordinateLsa coordA(adjA.getOrigRouter(), 1, MAX_TIME, 16.23, anglesA);
     lsdb.installCoordinateLsa(coordA);
 
     // Router B
@@ -84,7 +85,7 @@
     AdjLsa adjB(b.getName(), 1, MAX_TIME, 2, adjacencyListB);
     lsdb.installAdjLsa(adjB);
 
-    CoordinateLsa coordB(adjB.getOrigRouter(), 1, MAX_TIME, 16.59, 3.0);
+    CoordinateLsa coordB(adjB.getOrigRouter(), 1, MAX_TIME, 16.59, anglesB);
     lsdb.installCoordinateLsa(coordB);
 
     // Router C
@@ -98,12 +99,55 @@
     AdjLsa adjC(c.getName(), 1, MAX_TIME, 2, adjacencyListC);
     lsdb.installAdjLsa(adjC);
 
-    CoordinateLsa coordC(adjC.getOrigRouter(), 1, MAX_TIME, 14.11, 2.99);
+    CoordinateLsa coordC(adjC.getOrigRouter(), 1, MAX_TIME, 14.11, anglesC);
     lsdb.installCoordinateLsa(coordC);
 
     map.createFromAdjLsdb(nlsr);
   }
 
+  void runTest(const double& expectedCost)
+  {
+    HyperbolicRoutingCalculator calculator(map.getMapSize(), false, ROUTER_A_NAME);
+    calculator.calculatePaths(map, routingTable, lsdb, adjacencies);
+
+    RoutingTableEntry* entryB = routingTable.findRoutingTableEntry(ROUTER_B_NAME);
+
+    // Router A should be able to get to B through B with cost 0 and to B through C
+    NexthopList& bHopList = entryB->getNexthopList();
+    BOOST_REQUIRE_EQUAL(bHopList.getNextHops().size(), 2);
+
+    for (std::set<NextHop, NextHopComparator>::iterator it = bHopList.begin(); it != bHopList.end(); ++it) {
+      std::string faceUri = it->getConnectingFaceUri();
+      uint64_t cost = it->getRouteCostAsAdjustedInteger();
+
+      BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == 0) ||
+                  (faceUri == ROUTER_C_FACE && cost == applyHyperbolicFactorAndRound(expectedCost)));
+    }
+
+    RoutingTableEntry* entryC = routingTable.findRoutingTableEntry(ROUTER_C_NAME);
+
+    // Router A should be able to get to C through C with cost 0 and to C through B
+    NexthopList& cHopList = entryC->getNexthopList();
+    BOOST_REQUIRE_EQUAL(cHopList.getNextHops().size(), 2);
+
+    for (std::set<NextHop, NextHopComparator>::iterator it = cHopList.begin(); it != cHopList.end(); ++it) {
+      std::string faceUri = it->getConnectingFaceUri();
+      uint64_t cost = it->getRouteCostAsAdjustedInteger();
+
+      BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == applyHyperbolicFactorAndRound(expectedCost)) ||
+                  (faceUri == ROUTER_C_FACE && cost == 0));
+    }
+  }
+
+  uint64_t
+  applyHyperbolicFactorAndRound(double d)
+  {
+    // Hyperbolic costs in the tests were calculated with 1*10^-9 precision.
+    // A factor larger than 1*10^9 will cause the tests to fail.
+    BOOST_REQUIRE(NextHop::HYPERBOLIC_COST_ADJUSTMENT_FACTOR <= 1000000000);
+    return round(NextHop::HYPERBOLIC_COST_ADJUSTMENT_FACTOR*d);
+  }
+
 public:
   std::shared_ptr<ndn::util::DummyClientFace> face;
   Nlsr nlsr;
@@ -130,49 +174,26 @@
 const std::string HyperbolicCalculatorFixture::ROUTER_B_FACE = "udp4://10.0.0.2";
 const std::string HyperbolicCalculatorFixture::ROUTER_C_FACE = "udp4://10.0.0.3";
 
-uint64_t
-applyHyperbolicFactorAndRound(double d)
-{
-  // Hyperbolic costs in the tests were calculated with 1*10^-9 precision.
-  // A factor larger than 1*10^9 will cause the tests to fail.
-  BOOST_REQUIRE(NextHop::HYPERBOLIC_COST_ADJUSTMENT_FACTOR <= 1000000000);
-  return round(NextHop::HYPERBOLIC_COST_ADJUSTMENT_FACTOR*d);
-}
-
 BOOST_FIXTURE_TEST_SUITE(TestHyperbolicRoutingCalculator, HyperbolicCalculatorFixture)
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
-  HyperbolicRoutingCalculator calculator(map.getMapSize(), false, ROUTER_A_NAME);
-  calculator.calculatePaths(map, routingTable, lsdb, adjacencies);
+  std::vector<double> anglesA = {2.97},
+                      anglesB = {3.0},
+                      anglesC = {2.99};
+  setUpTopology(anglesA, anglesB, anglesC);
 
-  RoutingTableEntry* entryB = routingTable.findRoutingTableEntry(ROUTER_B_NAME);
+  runTest(20.103356956);
+}
 
-  // Router A should be able to get to B through B with cost 0 and to B through C
-  NexthopList& bHopList = entryB->getNexthopList();
-  BOOST_REQUIRE_EQUAL(bHopList.getNextHops().size(), 2);
+BOOST_AUTO_TEST_CASE(BasicMultipleAngles)
+{
+  std::vector<double> anglesA = {2.97,1.22},
+                      anglesB = {3.0, 0.09},
+                      anglesC = {321, 2.99};
+  setUpTopology(anglesA, anglesB, anglesC);
 
-  for (std::set<NextHop, NextHopComparator>::iterator it = bHopList.begin(); it != bHopList.end(); ++it) {
-    std::string faceUri = it->getConnectingFaceUri();
-    uint64_t cost = it->getRouteCostAsAdjustedInteger();
-
-    BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == 0) ||
-                (faceUri == ROUTER_C_FACE && cost == applyHyperbolicFactorAndRound(20.103356956)));
-  }
-
-  RoutingTableEntry* entryC = routingTable.findRoutingTableEntry(ROUTER_C_NAME);
-
-  // Router A should be able to get to C through C with cost 0 and to C through B
-  NexthopList& cHopList = entryC->getNexthopList();
-  BOOST_REQUIRE_EQUAL(cHopList.getNextHops().size(), 2);
-
-  for (std::set<NextHop, NextHopComparator>::iterator it = cHopList.begin(); it != cHopList.end(); ++it) {
-    std::string faceUri = it->getConnectingFaceUri();
-    uint64_t cost = it->getRouteCostAsAdjustedInteger();
-
-    BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == applyHyperbolicFactorAndRound(20.103356956)) ||
-                (faceUri == ROUTER_C_FACE && cost == 0));
-  }
+  runTest(30.655296361);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-lsa.cpp b/tests/test-lsa.cpp
index d7c97f9..e501c59 100644
--- a/tests/test-lsa.cpp
+++ b/tests/test-lsa.cpp
@@ -100,11 +100,14 @@
 BOOST_AUTO_TEST_CASE(CoordinateLsaConstructorAndGetters)
 {
   ndn::time::system_clock::TimePoint testTimePoint =  ndn::time::system_clock::now();
-  CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, 30.0);
-  CoordinateLsa clsa2("router1", 12, testTimePoint, 2.5, 30.0);
+  std::vector<double> angles1, angles2;
+  angles1.push_back(30.0);
+  angles2.push_back(30.0);
+  CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, angles1);
+  CoordinateLsa clsa2("router1", 12, testTimePoint, 2.5, angles2);
 
   BOOST_CHECK_CLOSE(clsa1.getCorRadius(), 2.5, 0.0001);
-  BOOST_CHECK_CLOSE(clsa1.getCorTheta(), 30.0, 0.0001);
+  BOOST_CHECK(clsa1.getCorTheta() == angles1);
 
   BOOST_CHECK(clsa1.isEqualContent(clsa2));
 
@@ -124,7 +127,6 @@
   adjList.insert(adj2);
 
   ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
-
   std::ostringstream ss;
   ss << testTimePoint;
 
@@ -133,21 +135,21 @@
   AdjLsa lsa("router1", 12, testTimePoint, adjList.getSize(), adjList);
 
   std::string EXPECTED_OUTPUT =
-    "Adj Lsa:\n"
-    "  Origination Router: /router1\n"
-    "  Ls Type: adjacency\n"
-    "  Ls Seq No: 12\n"
-    "  Ls Lifetime: " + TEST_TIME_POINT_STRING + "\n"
-    "  Adjacents: \n"
-    "    Adjacent 1:\n"
-    "      Adjacent Name: /adjacent1\n"
-    "      Connecting FaceUri: ://\n"
-    "      Link Cost: 10\n"
-    "    Adjacent 2:\n"
-    "      Adjacent Name: /adjacent2\n"
-    "      Connecting FaceUri: ://\n"
-    "      Link Cost: 10\n"
-    "adj_lsa_end";
+   "Adj Lsa:\n"
+   "  Origination Router: /router1\n"
+   "  Ls Type: adjacency\n"
+   "  Ls Seq No: 12\n"
+   "  Ls Lifetime: " + TEST_TIME_POINT_STRING + "\n"
+   "  Adjacents: \n"
+   "    Adjacent 1:\n"
+   "      Adjacent Name: /adjacent1\n"
+   "      Connecting FaceUri: ://\n"
+   "      Link Cost: 10\n"
+   "    Adjacent 2:\n"
+   "      Adjacent Name: /adjacent2\n"
+   "      Connecting FaceUri: ://\n"
+   "      Link Cost: 10\n"
+   "adj_lsa_end";
 
   std::ostringstream os;
   os << lsa;
@@ -200,7 +202,8 @@
   BOOST_CHECK_EQUAL(nlsa1.getData(), nlsa2.getData());
 
   //Coordinate LSA
-  CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, 30.0);
+  std::vector<double> angles = {30, 40.0};
+  CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, angles);
   CoordinateLsa clsa2;
 
   BOOST_CHECK(clsa2.initializeFromContent(clsa1.getData()));
diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp
index 76ca830..6e47e1c 100644
--- a/tests/test-sync-logic-handler.cpp
+++ b/tests/test-sync-logic-handler.cpp
@@ -209,9 +209,11 @@
                 3 , adjList);
   lsdb.installAdjLsa(adjLsa);
 
+  std::vector<double> angles = {0.0};
+
   // Install Cor LSA
   CoordinateLsa corLsa(originRouter, 1000, ndn::time::system_clock::TimePoint::max(),
-                       0,0);
+                       0, angles);
   lsdb.installCoordinateLsa(corLsa);
 
   std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
diff --git a/tests/tlv/test-coordinate-lsa.cpp b/tests/tlv/test-coordinate-lsa.cpp
index f7789c4..fa05d95 100644
--- a/tests/tlv/test-coordinate-lsa.cpp
+++ b/tests/tlv/test-coordinate-lsa.cpp
@@ -24,7 +24,7 @@
 #include "../boost-test.hpp"
 
 namespace nlsr {
-namespace tlv  {
+namespace tlv {
 namespace test {
 
 BOOST_AUTO_TEST_SUITE(TlvTestCoordinateLsa)
@@ -53,7 +53,9 @@
   coordinateLsa.setLsaInfo(lsaInfo);
 
   coordinateLsa.setHyperbolicRadius(1.65);
-  coordinateLsa.setHyperbolicAngle(1.78);
+  std::vector<double> angles;
+  angles.push_back(1.78);
+  coordinateLsa.setHyperbolicAngle(angles);
 
   const ndn::Block& wire = coordinateLsa.wireEncode();
 
@@ -73,7 +75,8 @@
   BOOST_REQUIRE_EQUAL(coordinateLsa.getLsaInfo().getExpirationPeriod(),
                       ndn::time::milliseconds(10000));
   BOOST_REQUIRE_EQUAL(coordinateLsa.getHyperbolicRadius(), 1.65);
-  BOOST_REQUIRE_EQUAL(coordinateLsa.getHyperbolicAngle(), 1.78);
+  std::vector<double> angles = {1.78};
+  BOOST_REQUIRE(coordinateLsa.getHyperbolicAngle() == angles);
 }
 
 BOOST_AUTO_TEST_CASE(CoordinateLsaOutputStream)
@@ -87,7 +90,8 @@
   coordinateLsa.setLsaInfo(lsaInfo);
 
   coordinateLsa.setHyperbolicRadius(1.65);
-  coordinateLsa.setHyperbolicAngle(1.78);
+  std::vector<double> angles = {1.78};
+  coordinateLsa.setHyperbolicAngle(angles);
 
   std::ostringstream os;
   os << coordinateLsa;
@@ -97,9 +101,23 @@
                                         "SequenceNumber: 128, "
                                         "ExpirationPeriod: 10000 milliseconds), "
                                 "HyperbolicRadius: 1.65, "
-                                "HyperbolicAngle: 1.78)");
+                                "HyperbolicAngles: 1.78)");
+
+  angles.push_back(3.21);
+  coordinateLsa.setHyperbolicAngle(angles);
+
+  std::ostringstream os2;
+  os2 << coordinateLsa;
+
+  BOOST_CHECK_EQUAL(os2.str(), "CoordinateLsa("
+                                "LsaInfo(OriginRouter: /test, "
+                                        "SequenceNumber: 128, "
+                                        "ExpirationPeriod: 10000 milliseconds), "
+                                "HyperbolicRadius: 1.65, "
+                                "HyperbolicAngles: 1.78, 3.21)");
 }
 
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
diff --git a/tests/tlv/test-lsdb-status.cpp b/tests/tlv/test-lsdb-status.cpp
index 5b15fa0..12284e8 100644
--- a/tests/tlv/test-lsdb-status.cpp
+++ b/tests/tlv/test-lsdb-status.cpp
@@ -22,9 +22,11 @@
 #include "tlv/lsdb-status.hpp"
 
 #include "../boost-test.hpp"
+#include <boost/mpl/vector.hpp>
+#include <boost/lexical_cast.hpp>
 
 namespace nlsr {
-namespace tlv  {
+namespace tlv {
 namespace test {
 
 BOOST_AUTO_TEST_SUITE(TlvTestLsdbStatus)
@@ -123,7 +125,9 @@
   coordinateLsa.setLsaInfo(lsaInfo);
 
   coordinateLsa.setHyperbolicRadius(1.65);
-  coordinateLsa.setHyperbolicAngle(1.78);
+  std::vector<double> angles;
+  angles.push_back(1.78);
+  coordinateLsa.setHyperbolicAngle(angles);
 
   lsdbStatus.addCoordinateLsa(coordinateLsa);
 
@@ -183,7 +187,9 @@
   BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
 
   BOOST_REQUIRE_EQUAL(it3->getHyperbolicRadius(), 1.65);
-  BOOST_REQUIRE_EQUAL(it3->getHyperbolicAngle(), 1.78);
+  std::vector<double> angles;
+  angles.push_back(1.78);
+  BOOST_REQUIRE(it3->getHyperbolicAngle() == angles);
 
   BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), true);
 
@@ -250,7 +256,9 @@
   coordinateLsa.setLsaInfo(lsaInfo);
 
   coordinateLsa.setHyperbolicRadius(1.65);
-  coordinateLsa.setHyperbolicAngle(1.78);
+  std::vector<double> angles;
+  angles.push_back(1.78);
+  coordinateLsa.setHyperbolicAngle(angles);
 
   lsdbStatus.addCoordinateLsa(coordinateLsa);
   BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), true);
@@ -268,8 +276,23 @@
   BOOST_CHECK_EQUAL(lsdbStatus.hasNameLsas(), false);
 }
 
-BOOST_AUTO_TEST_CASE(LsdbStatusOutputStream)
+class Theta
 {
+public:
+  std::vector<double> angles = {1.78};
+};
+
+class ThetaAndPhi
+{
+public:
+  std::vector<double> angles = {1.78, 3.21};
+};
+
+typedef boost::mpl::vector<Theta, ThetaAndPhi> HyperbolicAngleVectorFixture;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(LsdbStatusOutputStream, HRAngleVector, HyperbolicAngleVectorFixture)
+{
+  HRAngleVector angleVector;
   LsdbStatus lsdbStatus;
 
   LsaInfo lsaInfo;
@@ -289,22 +312,34 @@
 
   lsdbStatus.addAdjacencyLsa(adjacencyLsa);
 
-  // CoordinateLsa
-  CoordinateLsa coordinateLsa;
-  coordinateLsa.setLsaInfo(lsaInfo);
-
-  coordinateLsa.setHyperbolicRadius(1.65);
-  coordinateLsa.setHyperbolicAngle(1.78);
-
-  lsdbStatus.addCoordinateLsa(coordinateLsa);
-
-  // NameLsa
+    // NameLsa
   NameLsa nameLsa;
   nameLsa.setLsaInfo(lsaInfo);
   nameLsa.addName("name1");
 
   lsdbStatus.addNameLsa(nameLsa);
 
+  // CoordinateLsa
+  CoordinateLsa coordinateLsa;
+  coordinateLsa.setLsaInfo(lsaInfo);
+
+  coordinateLsa.setHyperbolicRadius(1.65);
+  coordinateLsa.setHyperbolicAngle(angleVector.angles);
+
+  std::string outputAngles = "HyperbolicAngles: ";
+  for (uint i = 0; i < angleVector.angles.size(); i++) {
+    std::string angle = boost::lexical_cast<std::string>(angleVector.angles[i]);
+    if (i == angleVector.angles.size()-1) {
+      outputAngles += angle;
+    }
+    else {
+      outputAngles += angle + ", ";
+    }
+  }
+  outputAngles += "), ";
+
+  lsdbStatus.addCoordinateLsa(coordinateLsa);
+
   std::ostringstream os;
   os << lsdbStatus;
 
@@ -321,7 +356,7 @@
                                     "SequenceNumber: 128, "
                                     "ExpirationPeriod: 10000 milliseconds), "
                                   "HyperbolicRadius: 1.65, "
-                                  "HyperbolicAngle: 1.78), "
+                                  + outputAngles +
                                 "NameLsa("
                                   "LsaInfo("
                                     "OriginRouter: /test, "
