public boolean equals(final Object o, final boolean flipMacs) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    final HandshakeSecrets that = (HandshakeSecrets) o;
    final KeccakDigest vsEgress = flipMacs ? that.ingressMac : that.egressMac;
    final KeccakDigest vsIngress = flipMacs ? that.egressMac : that.ingressMac;
    return Arrays.equals(aesSecret, that.aesSecret)
        && Arrays.equals(macSecret, that.macSecret)
        && Arrays.equals(token, that.token)
        && Arrays.equals(snapshot(egressMac), snapshot(vsEgress))
        && Arrays.equals(snapshot(ingressMac), snapshot(vsIngress));
  }
Performs an equals comparison with the ability to flip the MAC comparison, catering for
scenarios where we want to compare the handshake secrets on opposing ends of a channel.

@param o The object whose equality to test with this.
@param flipMacs Whether the egress MAC should be compared against the ingress MAC, and
    viceversa.
@return Whether both objects are equal or not.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/HandshakeSecrets.java