### Question:
PeerDiscoveryAgent { public boolean isActive() { return isActive; } protected  PeerDiscoveryAgent(
      final NodeKey nodeKey,
      final DiscoveryConfiguration config,
      final PeerPermissions peerPermissions,
      final NatService natService,
      final MetricsSystem metricsSystem); abstract CompletableFuture<?> stop(); CompletableFuture<Integer> start(final int tcpPort); void addPeerRequirement(final PeerRequirement peerRequirement); Stream<DiscoveryPeer> streamDiscoveredPeers(); void dropPeer(final PeerId peer); Optional<DiscoveryPeer> getAdvertisedPeer(); Bytes getId(); long observePeerBondedEvents(final PeerBondedObserver observer); boolean removePeerBondedObserver(final long observerId); @VisibleForTesting int getObserverCount(); boolean isActive(); void bond(final Peer peer);  }### Answer:
@Test public void shouldBeActiveWhenConfigIsTrue() { final AgentBuilder agentBuilder = helper.agentBuilder().active(true); final MockPeerDiscoveryAgent agent = helper.startDiscoveryAgent(agentBuilder); assertThat(agent.isActive()).isTrue(); }
@Test public void shouldNotBeActiveWhenConfigIsFalse() { final AgentBuilder agentBuilder = helper.agentBuilder().active(false); final MockPeerDiscoveryAgent agent = helper.startDiscoveryAgent(agentBuilder); assertThat(agent.isActive()).isFalse(); }