### Question:
DefaultMacroManager implements MacroManager { @Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; }  @Override Set<MacroId> getMacroIds(); @Override Set<MacroId> getMacroIds(Syntax syntax); @Override Macro<?> getMacro(MacroId macroId); @Override boolean exists(MacroId macroId);  }### Answer:
@Test public void testMacroExists() throws Exception { Assert.assertTrue(getMockedComponent().exists(new MacroId("testsimplemacro"))); }
@Test public void testSyntaxSpecificMacroExistsWhenMacroIsRegisteredForAllSyntaxes() throws Exception { Assert.assertFalse(getMockedComponent().exists(new MacroId("testsimplemacro", new Syntax(SyntaxType.XWIKI, "2.0")))); }