### Question:
DumpedPrivateKey extends PrefixedChecksummedBytes { public static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException, AddressFormatException.WrongNetwork { byte[] versionAndDataBytes = Base58.decodeChecked(base58); int version = versionAndDataBytes[0] & 0xFF; byte[] bytes = Arrays.copyOfRange(versionAndDataBytes, 1, versionAndDataBytes.length); if (params == null) { for (NetworkParameters p : Networks.get()) if (version == p.getDumpedPrivateKeyHeader()) return new DumpedPrivateKey(p, bytes); throw new AddressFormatException.InvalidPrefix("No network found for version " + version); } else { if (version == params.getDumpedPrivateKeyHeader()) return new DumpedPrivateKey(params, bytes); throw new AddressFormatException.WrongNetwork(version); } } private  DumpedPrivateKey(NetworkParameters params, byte[] bytes);   DumpedPrivateKey(NetworkParameters params, byte[] keyBytes, boolean compressed); static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58); String toBase58(); ECKey getKey(); boolean isPubKeyCompressed(); @Override String toString();  }### Answer:
@Test public void checkNetwork() throws Exception { DumpedPrivateKey.fromBase58(MAINNET, "5HtUCLMFWNueqN9unpgX2DzjMg6SDNZyKRb8s3LJgpFg5ubuMrk"); }
@Test(expected = AddressFormatException.WrongNetwork.class) public void checkNetworkWrong() throws Exception { DumpedPrivateKey.fromBase58(TESTNET, "5HtUCLMFWNueqN9unpgX2DzjMg6SDNZyKRb8s3LJgpFg5ubuMrk"); }
@Test(expected = AddressFormatException.InvalidDataLength.class) public void fromBase58_tooShort() { String base58 = Base58.encodeChecked(MAINNET.dumpedPrivateKeyHeader, new byte[31]); DumpedPrivateKey.fromBase58(null, base58); }
@Test(expected = AddressFormatException.InvalidDataLength.class) public void fromBase58_tooLong() { String base58 = Base58.encodeChecked(MAINNET.dumpedPrivateKeyHeader, new byte[34]); DumpedPrivateKey.fromBase58(null, base58); }
@Test public void checkNetwork() throws Exception { DumpedPrivateKey.fromBase58(MAINNET, "7rZrMXc6R9TeuMa5UCX8i9Ffn1r3d8ypp6dJkmg1JEPZNhQodL8"); }
@Test(expected = AddressFormatException.WrongNetwork.class) public void checkNetworkWrong() throws Exception { DumpedPrivateKey.fromBase58(TESTNET, "7rZrMXc6R9TeuMa5UCX8i9Ffn1r3d8ypp6dJkmg1JEPZNhQodL8"); }