class MethodInvokerMethodInterceptor implements MethodInterceptor {

	private final Map<String, Set<MethodInvoker>> invokerMap;

	private final boolean ordered;

	public MethodInvokerMethodInterceptor(Map<String, Set<MethodInvoker>> invokerMap) {
		this(invokerMap, false);
	}

	public MethodInvokerMethodInterceptor(Map<String, Set<MethodInvoker>> invokerMap, boolean ordered) {
		this.ordered = ordered;
		this.invokerMap = invokerMap;
	}

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {<FILL_FUNCTION_BODY>}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof MethodInvokerMethodInterceptor other)) {
			return false;
		}
		return invokerMap.equals(other.invokerMap);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		return invokerMap.hashCode();
	}

}


		String methodName = invocation.getMethod().getName();
		if (ordered && methodName.equals("getOrder")) {
			return invocation.proceed();
		}

		Set<MethodInvoker> invokers = invokerMap.get(methodName);

		if (invokers == null) {
			return null;
		}
		ExitStatus status = null;
		for (MethodInvoker invoker : invokers) {
			Object retVal = invoker.invokeMethod(invocation.getArguments());
			if (retVal instanceof ExitStatus) {
				if (status != null) {
					status = status.and((ExitStatus) retVal);
				}
				else {
					status = (ExitStatus) retVal;
				}
			}
		}

		// The only possible return values are ExitStatus or int (from Ordered)
		return status;
	
<no_super_class>