@Override public <A, R> Status<R> execute(Request request, Command<? super A, ? super R> command, A arg, ContextT context) { CommandImplementation<A, R, ContextT> implementation = (CommandImplementation<A, R, ContextT>) implementations.get(command); if (implementation == null) { return Status.from(new CommandNotSupportedException(command.getCommandName())); } return implementation.apply(request, command, arg, context); }