code: @SuppressWarnings("unchecked")
    <T extends Operation<U>, U> U executeOperation(Commit commit) {
      // If the commit operation is a no-op command, complete the operation.
      if (commit.operation() instanceof NoOpCommand) {
        commit.close();
        return null;
      }
  
      // Get the function registered for the operation. If no function is registered, attempt to
      // use a global function if available.
      Function function = operations.get(commit.type());
  
      if (function == null) {
        // If no operation function was found for the class, try to find an operation function
        // registered with a parent class.
        for (Map.Entry<Class, Function> entry : operations.entrySet()) {
          if (entry.getKey().isAssignableFrom(commit.type())) {
            function = entry.getValue();
            break;
          }
        }
  
        // If a parent operation function was found, store the function for future reference.
        if (function != null) {
          operations.put(commit.type(), function);
        }
      }
  
      if (function == null) {
        throw new IllegalStateException("unknown state machine operation: " + commit.type());
      } else {
        // Execute the operation. If the operation return value is a Future, await the result,
        // otherwise immediately complete the execution future.
        try {
          return (U) function.apply(commit);
        } catch (Exception e) {
          LOGGER.warn("State machine operation failed: {}", e);
          throw new ApplicationException(e, "An application error occurred");
        }
      }
    }
docs: Executes an operation.