@@ -0,0 +1,2627 @@
+/*%0A * Copyright 2021 Dash Core Group%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.bitcoinj.net.discovery;%0A%0Aimport org.bitcoinj.core.NetworkParameters;%0Aimport org.bitcoinj.core.VersionMessage;%0Aimport org.bitcoinj.params.MainNetParams;%0Aimport org.bitcoinj.params.TestNet3Params;%0Aimport org.junit.Test;%0A%0Aimport java.net.InetSocketAddress;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.hamcrest.CoreMatchers.notNullValue;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.assertThrows;%0A%0Apublic class MasternodeSeedPeersTest %7B%0A    private static final NetworkParameters TESTNET = TestNet3Params.get();%0A%0A    @Test%0A    public void getPeer_one() throws Exception%7B%0A        MasternodeSeedPeers seedPeers = new MasternodeSeedPeers(TESTNET);%0A        assertThat(seedPeers.getPeer(), notNullValue());%0A    %7D%0A    %0A    @Test%0A    public void getPeer_all() throws Exception%7B%0A        MasternodeSeedPeers seedPeers = new MasternodeSeedPeers(TESTNET);%0A        for (int i = 0; i %3C TESTNET.getDefaultMasternodeList().length; ++i) %7B%0A            assertThat(%22Failed on index: %22+i, seedPeers.getPeer(), notNullValue());%0A        %7D%0A        assertThat(seedPeers.getPeer(), equalTo(null));%0A    %7D%0A    %0A    @Test%0A    public void getPeers_length() throws Exception%7B%0A        MasternodeSeedPeers seedPeers = new MasternodeSeedPeers(TESTNET);%0A        InetSocketAddress%5B%5D addresses = seedPeers.getPeers(0, 0, TimeUnit.SECONDS);%0A        assertThat(addresses.length, equalTo(TESTNET.getDefaultMasternodeList().length));%0A    %7D%0A%0A    @Test%0A    public void getPeers_services() %7B%0A        MasternodeSeedPeers seedPeers = new MasternodeSeedPeers(TESTNET);%0A        assertThrows(PeerDiscoveryException.class, () -%3E seedPeers.getPeers(VersionMessage.NODE_NETWORK, 0, TimeUnit.SECONDS));%0A    %7D%0A%0A    @Test%0A    public void getPeers_empty() %7B%0A        MasternodeSeedPeers seedPeers = new MasternodeSeedPeers(new String %5B0%5D, TESTNET);%0A        assertThrows(PeerDiscoveryException.class, () -%3E seedPeers.getPeers(VersionMessage.NODE_NETWORK, 0, TimeUnit.SECONDS));%0A    %7D%0A%7D%0A

add MasternodeSeedPeersTest