class ReadinessCheck implements HealthService.HealthCheck {

  @Override
  public boolean isHealthy(final HealthService.ParamSource params) {
    LOG.debug("Invoking readiness check.");
    if (p2pNetwork.isP2pEnabled()) {
      final int peerCount = p2pNetwork.getPeerCount();
      if (!hasMinimumPeers(params, peerCount)) {
        return false;
      }
    }
    return synchronizer
        .getSyncStatus()
        .map(syncStatus -> isInSync(syncStatus, params))
        .orElse(true);
  }

  public  ReadinessCheck(final P2PNetwork p2pNetwork, final Synchronizer synchronizer);

}