private void respondToMessage(final Responder responder, final OutgoingMessage msg) {
    boolean supportsRequestId = EthProtocol.requestIdCompatible(msg.messageData.getCode());
    final Optional<MessageData> maybeResponse =
        responder.respond(
            msg.capability,
            supportsRequestId ? msg.messageData.unwrapMessageData().getValue() : msg.messageData);
    maybeResponse.ifPresent(
        (response) -> {
          if (ethProtocolManager.getSupportedCapabilities().contains(msg.capability)) {
            ethProtocolManager.processMessage(
                msg.capability,
                new DefaultMessage(
                    peerConnection,
                    supportsRequestId
                        ? response.wrapMessageData(msg.messageData.unwrapMessageData().getKey())
                        : response));
          } else
            snapProtocolManager.ifPresent(
                protocolManager ->
                    protocolManager.processMessage(
                        msg.capability, new DefaultMessage(peerConnection, response)));
        });
  }
@return True if any requests were processed
ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/RespondingEthPeer.java