class InsufficientPeersPermissioningProvider implements ContextualNodePermissioningProvider {

  @Override
  public Optional<Boolean> isPermitted(
      final EnodeURL sourceEnode, final EnodeURL destinationEnode) {
    Optional<EnodeURL> maybeSelfEnode = p2pNetwork.getLocalEnode();
    if (nonBootnodePeerConnections > 0) {
      return Optional.empty();
    } else if (!maybeSelfEnode.isPresent()) {
      // The local node is not yet ready, so we can't validate enodes yet
      return Optional.empty();
    } else if (checkEnode(maybeSelfEnode.get(), sourceEnode)
        && checkEnode(maybeSelfEnode.get(), destinationEnode)) {
      return Optional.of(true);
    } else {
      return Optional.empty();
    }
  }

  public  InsufficientPeersPermissioningProvider(
      final P2PNetwork p2pNetwork, final Collection<EnodeURL> bootnodeEnodes);

}