### Question:
Base58 { public static byte[] decodeChecked(String input) throws AddressFormatException { byte[] decoded = decode(input); if (decoded.length < 4) throw new AddressFormatException.InvalidDataLength("Input too short: " + decoded.length); byte[] data = Arrays.copyOfRange(decoded, 0, decoded.length - 4); byte[] checksum = Arrays.copyOfRange(decoded, decoded.length - 4, decoded.length); byte[] actualChecksum = Arrays.copyOfRange(Sha256Hash.hashTwice(data), 0, 4); if (!Arrays.equals(checksum, actualChecksum)) throw new AddressFormatException.InvalidChecksum(); return data; }  static String encode(byte[] input); static String encodeChecked(int version, byte[] payload); static byte[] decode(String input); static BigInteger decodeToBigInteger(String input); static byte[] decodeChecked(String input); static final char[] ALPHABET; }### Answer:
@Test public void testDecodeChecked() { Base58.decodeChecked("4stwEBjT6FYyVV"); Base58.decodeChecked("93VYUMzRG9DdbRP72uQXjaWibbQwygnvaCu9DumcqDjGybD864T"); }
@Test(expected = AddressFormatException.InvalidCharacter.class) public void decode_invalidCharacter_notInAlphabet() { Base58.decodeChecked("J0F12TrwUP45BMd"); }
@Test(expected = AddressFormatException.InvalidChecksum.class) public void testDecodeChecked_invalidChecksum() { Base58.decodeChecked("4stwEBjT6FYyVW"); }
@Test(expected = AddressFormatException.InvalidDataLength.class) public void testDecodeChecked_shortInput() { Base58.decodeChecked("4s"); }