diff --git a/test/utest.cpp b/test/utest.cpp
index 455179c..18a4341 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -1,22 +1,24 @@
-#include <set>
-#include <algorithm>
-#include <gtest/gtest.h>
-#include <sdbusplus/bus.hpp>
-#include "manager.hpp"
 #include "led-test-map.hpp"
+#include "manager.hpp"
+
+#include <algorithm>
+#include <sdbusplus/bus.hpp>
+#include <set>
+
+#include <gtest/gtest.h>
 using namespace phosphor::led;
 class LedTest : public ::testing::Test
 {
-    public:
-        sdbusplus::bus::bus bus;
-        LedTest() : bus(sdbusplus::bus::new_default())
-        {
-            // Nothing here
-        }
-        ~LedTest()
-        {
-            // Leaving up to auto cleanup.
-        }
+  public:
+    sdbusplus::bus::bus bus;
+    LedTest() : bus(sdbusplus::bus::new_default())
+    {
+        // Nothing here
+    }
+    ~LedTest()
+    {
+        // Leaving up to auto cleanup.
+    }
 };
 
 /** @brief Assert Single LED to On */
@@ -25,24 +27,24 @@
     Manager manager(bus, singleLedOn);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -56,24 +58,24 @@
     Manager manager(bus, singleLedBlink);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -87,24 +89,24 @@
     Manager manager(bus, singleLedOn);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -112,12 +114,12 @@
     }
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         EXPECT_EQ(0, ledsAssert.size());
@@ -131,28 +133,26 @@
     Manager manager(bus, multipleLedsOn);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -166,28 +166,28 @@
     Manager manager(bus, multipleLedsBlink);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -201,28 +201,28 @@
     Manager manager(bus, multipleLedsBlink);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -230,28 +230,28 @@
     }
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -265,28 +265,28 @@
     Manager manager(bus, multipleLedsBlink);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -294,28 +294,28 @@
     }
     {
         // DeAssert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -323,12 +323,12 @@
     }
     {
         // DeAssert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
         EXPECT_EQ(0, ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
@@ -341,32 +341,31 @@
     Manager manager(bus, multipleLedsOnAndBlink);
     {
         // Assert the LEDs.
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
         auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::On,
-                0, phosphor::led::Layout::Blink},
-            {"Three",phosphor::led::Layout::Blink,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On,
-                0, phosphor::led::Layout::Blink},
-            {"Five",phosphor::led::Layout::On,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::On, 0, phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::Blink, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0,
+             phosphor::led::Layout::Blink},
+            {"Five", phosphor::led::Layout::On, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -380,28 +379,27 @@
     Manager manager(bus, twoGroupsWithDistinctLEDsOn);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -409,28 +407,27 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -444,28 +441,26 @@
     Manager manager(bus, twoGroupsWithOneComonLEDOn);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -473,26 +468,25 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -507,28 +501,26 @@
     Manager manager(bus, twoGroupsWithOneComonLEDOnOneLEDBlinkPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -536,27 +528,26 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // Does not action on [Three] since  priority is [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -564,27 +555,26 @@
     }
     {
         // De-Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
         // [Three] is not touched since its already [Blink]
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -599,28 +589,26 @@
     Manager manager(bus, twoGroupsWithOneComonLEDOnOneLEDBlinkPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -628,27 +616,26 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // [Three] does not get actioned since it has Blink priority
         std::set<Layout::LedAction> refAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -656,25 +643,23 @@
     }
     {
         // De-Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -682,13 +667,13 @@
 
         // Need just the ledsAssert populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp1 {};
+        Manager::group temp1{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp1, temp1.begin()));
@@ -703,28 +688,26 @@
     Manager manager(bus, twoGroupsWithOneComonLEDOnPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true,
-                                            ledsAssert, ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -732,56 +715,53 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // Three is set to ON due to ON priority.
         std::set<Layout::LedAction> refAssert = {
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
     }
     {
         // De-Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAssserted populated with these.
         // [Three] stays in [On] since [B] has it [On]
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -796,28 +776,26 @@
     Manager manager(bus, twoGroupsWithOneComonLEDOnPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -825,54 +803,52 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // Three is set to ON due to ON priority.
         std::set<Layout::LedAction> refAssert = {
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
     }
     {
         // De-Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -881,13 +857,13 @@
         // Need just the ledsAssert populated with these.
         // Since [Three] stood [On], need to go back to [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp1 {};
+        Manager::group temp1{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -901,30 +877,28 @@
     Manager manager(bus, twoGroupsWithMultiplComonLEDOn);
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Seven",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Seven", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -932,24 +906,23 @@
     }
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -957,31 +930,29 @@
     }
     {
         // De-Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Seven",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Seven", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
         EXPECT_EQ(0, temp.size());
-
     }
 }
 
@@ -991,30 +962,28 @@
     Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1022,28 +991,27 @@
     }
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these
         // [Two] remains [On] due to higher priority.
         // [Three] remains [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1057,31 +1025,30 @@
     Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.'Two' gets to Blink
         // due to higher priority.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1089,30 +1056,28 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // [Three] remains [Blink] from previous
         // [Two] moves to [On] from [Blink] due to [On] priority
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1123,35 +1088,35 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state
  *  DeAssert twice
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateAtoBDeAssertTwice)
+TEST_F(LedTest,
+       assertTwoGroupsWithMultipleComonLEDInDifferentStateAtoBDeAssertTwice)
 {
     Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1159,30 +1124,28 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         // [Two] turns [On] due to priority
         // [Three] remains [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1190,25 +1153,24 @@
     }
     {
         // DeAssert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1217,13 +1179,13 @@
         // Need just the ledsAssert populated with these.
         // [Two] will go back to [Blink] from [On]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp1 {};
+        Manager::group temp1{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp1, temp1.begin()));
@@ -1231,30 +1193,29 @@
     }
     {
         // DeAssert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1262,12 +1223,12 @@
     }
     {
         // DeAssert Set-A again and make sure we get all empty
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
         EXPECT_EQ(0, ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
@@ -1277,37 +1238,38 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state and
  *  mixed priority. DeAssert-A
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityAandB)
+TEST_F(LedTest,
+       assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityAandB)
 {
-    Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
+    Manager manager(bus,
+                    twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1315,12 +1277,12 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
@@ -1328,18 +1290,16 @@
         // [Three] remains on since it never was in [Blink] before
         // [Ten] remains [Blink] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1347,20 +1307,19 @@
     }
     {
         // De-Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAsssert populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
@@ -1369,13 +1328,13 @@
         // [Three] remains [On] since it never changed state.
         // [Two] remains [On] since it did not go back
         std::set<Layout::LedAction> refAssert = {
-            {"Ten",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Ten", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1386,37 +1345,39 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state and
  *  mixed priority. DeAssert-B
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityAandBDeAssertB)
+TEST_F(
+    LedTest,
+    assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityAandBDeAssertB)
 {
-    Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
+    Manager manager(bus,
+                    twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1424,12 +1385,12 @@
     }
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
@@ -1437,18 +1398,16 @@
         // [Three] remains on since it never was in [Blink] before
         // [Ten] remains [Blink] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1456,20 +1415,19 @@
     }
     {
         // De-Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsDeAsssert populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
@@ -1478,13 +1436,13 @@
         // [Three] remains [On] since it never changed state.
         // [Two] moves to [Blink] since there is no prior [On]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1495,37 +1453,37 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state and
  *  mixed priority.
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityBandA)
+TEST_F(LedTest,
+       assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityBandA)
 {
-    Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
+    Manager manager(bus,
+                    twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1533,12 +1491,12 @@
     }
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
@@ -1546,18 +1504,17 @@
         // [Three] remains on since it never was in [Blink] before
         // [Ten] moves to [Blink] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1568,37 +1525,38 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state and
  *  mixed priority and De-Assert-A
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityBandADeAssertA)
+TEST_F(
+    LedTest,
+    assertTwoGroupsWithMultipleComonLEDInDifferentStateDiffPriorityBandADeAssertA)
 {
-    Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
+    Manager manager(bus,
+                    twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1606,12 +1564,12 @@
     }
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
@@ -1619,18 +1577,17 @@
         // [Three] remains on since it never was in [Blink] before
         // [Ten] moves to [Blink] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1638,21 +1595,20 @@
     }
     {
         // De-Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         // [Ten] remains [Blink] due to priority.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
@@ -1661,13 +1617,13 @@
         // [Three] remains [On] since it never was in [Blink] before
         // [Ten] moves to [On] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Ten",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Ten", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1678,37 +1634,37 @@
 /** @brief Assert 2 groups having multiple LEDs common in different state and
  *  mixed priority and then DeAssert twice.
  */
-TEST_F(LedTest, assertTwoGroupsWithMultipleComonLEDInDifferentStateOnBlinkPriorityBandA)
+TEST_F(LedTest,
+       assertTwoGroupsWithMultipleComonLEDInDifferentStateOnBlinkPriorityBandA)
 {
-    Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
+    Manager manager(bus,
+                    twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
     {
         // Assert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
+            {"Two", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1716,12 +1672,12 @@
     }
     {
         // Assert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, true, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
         EXPECT_EQ(true, result);
 
         // Need just the ledsAssserted populated with these.
@@ -1729,18 +1685,17 @@
         // [Three] remains on since it never was in [Blink] before
         // [Ten] moves to [Blink] due to priority: [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
         EXPECT_EQ(0, ledsDeAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1748,26 +1703,25 @@
     }
     {
         // DeAssert Set-B
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         // [Ten] remains [Blink] due to priority.
         std::set<Layout::LedAction> refDeAssert = {
-            {"Five",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Six",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
+            {"Five", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Six", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1776,13 +1730,13 @@
         // Need just the ledsAssert populated with these.
         // [Two] will move to [Blink]
         std::set<Layout::LedAction> refAssert = {
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
         };
         EXPECT_EQ(refAssert.size(), ledsAssert.size());
 
         // difference of refAssert and ledsAssert must be null.
-        Manager::group temp1 {};
+        Manager::group temp1{};
         std::set_difference(ledsAssert.begin(), ledsAssert.end(),
                             refAssert.begin(), refAssert.end(),
                             std::inserter(temp1, temp1.begin()));
@@ -1790,32 +1744,31 @@
     }
     {
         // DeAssert Set-A
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
 
         // Need just the ledsAssserted populated with these.
         std::set<Layout::LedAction> refDeAssert = {
-            {"One",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Two",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::On},
-            {"Three",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::Blink},
-            {"Four",phosphor::led::Layout::On, 0,
-                0, phosphor::led::Layout::On},
-            {"Ten",phosphor::led::Layout::Blink, 0,
-                0, phosphor::led::Layout::Blink},
+            {"One", phosphor::led::Layout::On, 0, 0, phosphor::led::Layout::On},
+            {"Two", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::On},
+            {"Three", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::Blink},
+            {"Four", phosphor::led::Layout::On, 0, 0,
+             phosphor::led::Layout::On},
+            {"Ten", phosphor::led::Layout::Blink, 0, 0,
+             phosphor::led::Layout::Blink},
         };
         EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
 
         // difference of refDeAssert and ledsDeAssert must be null.
-        Manager::group temp {};
+        Manager::group temp{};
         std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
                             refDeAssert.begin(), refDeAssert.end(),
                             std::inserter(temp, temp.begin()));
@@ -1823,12 +1776,12 @@
     }
     {
         // DeAssert Set-B again and make sure we get all empty
-        Manager::group ledsAssert {};
-        Manager::group ledsDeAssert {};
+        Manager::group ledsAssert{};
+        Manager::group ledsDeAssert{};
 
-        auto group ="/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
-        auto result = manager.setGroupState(group, false, ledsAssert,
-                                            ledsDeAssert);
+        auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+        auto result =
+            manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
         EXPECT_EQ(false, result);
         EXPECT_EQ(0, ledsDeAssert.size());
         EXPECT_EQ(0, ledsAssert.size());
