class RoundChangeMessageValidator {

  public boolean validateRoundChange(final RoundChange msg) {

    if (!roundChangePayloadValidator.validateRoundChange(msg.getSignedPayload())) {
      LOG.info("Invalid RoundChange message, signed data did not validate correctly.");
      return false;
    }

    if (msg.getPreparedCertificate().isPresent() != msg.getProposedBlock().isPresent()) {
      LOG.info(
          "Invalid RoundChange message, availability of certificate does not correlate with availability of block.");
      return false;
    }

    if (msg.getPreparedCertificate().isPresent()) {
      if (!proposalBlockConsistencyValidator.validateProposalMatchesBlock(
          msg.getPreparedCertificate().get().getProposalPayload(), msg.getProposedBlock().get())) {
        LOG.info("Invalid RoundChange message, proposal did not align with supplied block.");
        return false;
      }
    }

    return true;
  }

  public  RoundChangeMessageValidator(
      final RoundChangePayloadValidator roundChangePayloadValidator,
      final ProposalBlockConsistencyValidator proposalBlockConsistencyValidator);

}