### Question:
AbstractPeerBlockValidator implements PeerValidator { @Override public boolean canBeValidated(final EthPeer ethPeer) { return ethPeer.chainState().getEstimatedHeight() >= (blockNumber + chainHeightEstimationBuffer); } AbstractPeerBlockValidator(
      final ProtocolSchedule protocolSchedule,
      final MetricsSystem metricsSystem,
      final long blockNumber,
      final long chainHeightEstimationBuffer); protected  AbstractPeerBlockValidator(
      final ProtocolSchedule protocolSchedule,
      final MetricsSystem metricsSystem,
      final long blockNumber); @Override CompletableFuture<Boolean> validatePeer(
      final EthContext ethContext, final EthPeer ethPeer); @Override boolean canBeValidated(final EthPeer ethPeer); @Override Duration nextValidationCheckTimeout(final EthPeer ethPeer);  }### Answer:
@Test public void canBeValidated() { final BlockDataGenerator gen = new BlockDataGenerator(1); final EthProtocolManager ethProtocolManager = EthProtocolManagerTestUtil.create(DeterministicEthScheduler.TimeoutPolicy.ALWAYS_TIMEOUT); final long blockNumber = 500; final long buffer = 10; final PeerValidator validator = createValidator(blockNumber, buffer); final EthPeer peer = EthProtocolManagerTestUtil.createPeer(ethProtocolManager, 0).getEthPeer(); peer.chainState().update(gen.hash(), blockNumber - 10); assertThat(validator.canBeValidated(peer)).isFalse(); peer.chainState().update(gen.hash(), blockNumber); assertThat(validator.canBeValidated(peer)).isFalse(); peer.chainState().update(gen.hash(), blockNumber + buffer - 1); assertThat(validator.canBeValidated(peer)).isFalse(); peer.chainState().update(gen.hash(), blockNumber + buffer); assertThat(validator.canBeValidated(peer)).isTrue(); peer.chainState().update(gen.hash(), blockNumber + buffer + 10); assertThat(validator.canBeValidated(peer)).isTrue(); }