### Question:
InvocationManagerImpl implements InvocationManager { @Override public void registerComponentInvocationHandler(ComponentInvocationType type, RegisteredComponentInvocationHandler handler) { typeHandlers.computeIfAbsent(type, key -> new ListComponentInvocationHandler(new CopyOnWriteArrayList<>())) .add(handler.getComponentInvocationHandler()); } InvocationManagerImpl();  InvocationManagerImpl(ComponentInvocationHandler... handlers); @Inject private  InvocationManagerImpl(@Optional IterableProvider<ComponentInvocationHandler> handlers); private  InvocationManagerImpl(Iterable<ComponentInvocationHandler> handlers); @Override void setThreadInheritableInvocation(List<? extends ComponentInvocation> parentValue); @Override void preInvoke(T invocation); @Override void postInvoke(T invocation); @Override boolean isInvocationStackEmpty(); @Override @SuppressWarnings("unchecked") T getCurrentInvocation(); @Override @SuppressWarnings("unchecked") T getPreviousInvocation(); @Override List<? extends ComponentInvocation> getAllInvocations(); @Override List<? extends ComponentInvocation> popAllInvocations(); @Override void putAllInvocations(List<? extends ComponentInvocation> invocations); @Override void registerComponentInvocationHandler(ComponentInvocationType type, RegisteredComponentInvocationHandler handler); @Override void pushAppEnvironment(ApplicationEnvironment env); @Override ApplicationEnvironment peekAppEnvironment(); @Override void popAppEnvironment(); @Override void pushWebServiceMethod(Method method); @Override Method peekWebServiceMethod(); @Override void popWebServiceMethod();  }### Answer:
@Test public void singleRegisteredHandlerIsCalled() { InvocationManager manager = new InvocationManagerImpl(); RegisteredComponentInvocationHandler handler = fakeRegisteredHandler(); manager.registerComponentInvocationHandler(SERVLET_INVOCATION, handler); assertCalledTimes(1, manager, handler.getComponentInvocationHandler(), SERVLET_INVOCATION); assertCalledTimes(0, manager, handler.getComponentInvocationHandler(), EJB_INVOCATION); assertCalledTimes(0, manager, handler.getComponentInvocationHandler(), APP_CLIENT_INVOCATION); }
@Test public void multipleRegisteredHandlersAreCalled() { InvocationManager manager = new InvocationManagerImpl(); RegisteredComponentInvocationHandler servletHandler = fakeRegisteredHandler(); manager.registerComponentInvocationHandler(SERVLET_INVOCATION, servletHandler); RegisteredComponentInvocationHandler ejbHandler = fakeRegisteredHandler(); manager.registerComponentInvocationHandler(EJB_INVOCATION, ejbHandler); assertCalledTimes(1, manager, servletHandler.getComponentInvocationHandler(), SERVLET_INVOCATION); assertCalledTimes(0, manager, servletHandler.getComponentInvocationHandler(), EJB_INVOCATION); assertCalledTimes(0, manager, servletHandler.getComponentInvocationHandler(), APP_CLIENT_INVOCATION); assertCalledTimes(0, manager, ejbHandler.getComponentInvocationHandler(), SERVLET_INVOCATION); assertCalledTimes(1, manager, ejbHandler.getComponentInvocationHandler(), EJB_INVOCATION); assertCalledTimes(0, manager, ejbHandler.getComponentInvocationHandler(), APP_CLIENT_INVOCATION); }