diff --git a/Trigger/TrigEvent/TrigNavTools/src/NavigationTesterAlg.cxx b/Trigger/TrigEvent/TrigNavTools/src/NavigationTesterAlg.cxx
index 13e1e6dd6f4cfe2d4171116ea62bb94b8c409591..acd08476b9328f9374544f92171acee19777d452 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/NavigationTesterAlg.cxx
+++ b/Trigger/TrigEvent/TrigNavTools/src/NavigationTesterAlg.cxx
@@ -19,7 +19,9 @@ namespace {
             ret.emplace(combination.begin(), combination.end());
         return ret;
     }
+}
 
+namespace xAOD {
     std::ostream &operator<<(std::ostream &os, const xAOD::IParticle *p)
     {
         return os << "["
@@ -30,7 +32,9 @@ namespace {
             << "]";
 
     }
+}
 
+namespace std {
     // Define printing operators for the set and IParticle pointers
     template <typename T>
     std::ostream &operator<<(std::ostream &os, const std::set<T> &s)