### Question:
SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); @Nullable InetSocketAddress getPeer(); InetSocketAddress[] getPeers(long timeoutValue, TimeUnit timeoutUnit); void shutdown(); static int[] seedAddrs; }### Answer:
@Test public void getPeer_one() throws Exception{ SeedPeers seedPeers = new SeedPeers(MainNetParams.get()); assertThat(seedPeers.getPeer(), notNullValue()); }
@Test public void getPeer_all() throws Exception{ SeedPeers seedPeers = new SeedPeers(MainNetParams.get()); for(int i = 0; i < SeedPeers.seedAddrs.length; ++i){ assertThat("Failed on index: "+i, seedPeers.getPeer(), notNullValue()); } assertThat(seedPeers.getPeer(), equalTo(null)); }