@Test public void shouldAllowConnectionInitiationToUnknownPeers() { assertThat(reputationManager.isConnectionInitiationAllowed(peerAddress)).isTrue(); }
public boolean isConnectionInitiationAllowed(final PeerAddress peerAddress) { return peerReputations .getCached(peerAddress.getId()) .map(reputation -> reputation.shouldInitiateConnection(timeProvider.getTimeInSeconds())) .orElse(true); }
ReputationManager { public boolean isConnectionInitiationAllowed(final PeerAddress peerAddress) { return peerReputations .getCached(peerAddress.getId()) .map(reputation -> reputation.shouldInitiateConnection(timeProvider.getTimeInSeconds())) .orElse(true); } }
ReputationManager { public boolean isConnectionInitiationAllowed(final PeerAddress peerAddress) { return peerReputations .getCached(peerAddress.getId()) .map(reputation -> reputation.shouldInitiateConnection(timeProvider.getTimeInSeconds())) .orElse(true); } ReputationManager(
      final MetricsSystem metricsSystem, final TimeProvider timeProvider, final int capacity); }
ReputationManager { public boolean isConnectionInitiationAllowed(final PeerAddress peerAddress) { return peerReputations .getCached(peerAddress.getId()) .map(reputation -> reputation.shouldInitiateConnection(timeProvider.getTimeInSeconds())) .orElse(true); } ReputationManager(
      final MetricsSystem metricsSystem, final TimeProvider timeProvider, final int capacity); void reportInitiatedConnectionFailed(final PeerAddress peerAddress); boolean isConnectionInitiationAllowed(final PeerAddress peerAddress); void reportInitiatedConnectionSuccessful(final PeerAddress peerAddress); void reportDisconnection(
      final PeerAddress peerAddress,
      final Optional<DisconnectReason> reason,
      final boolean locallyInitiated); }
ReputationManager { public boolean isConnectionInitiationAllowed(final PeerAddress peerAddress) { return peerReputations .getCached(peerAddress.getId()) .map(reputation -> reputation.shouldInitiateConnection(timeProvider.getTimeInSeconds())) .orElse(true); } ReputationManager(
      final MetricsSystem metricsSystem, final TimeProvider timeProvider, final int capacity); void reportInitiatedConnectionFailed(final PeerAddress peerAddress); boolean isConnectionInitiationAllowed(final PeerAddress peerAddress); void reportInitiatedConnectionSuccessful(final PeerAddress peerAddress); void reportDisconnection(
      final PeerAddress peerAddress,
      final Optional<DisconnectReason> reason,
      final boolean locallyInitiated);  }