### Question:
Base58 { public static String encodeChecked(int version, byte[] payload) { if (version < 0 || version > 255) throw new IllegalArgumentException("Version not in range."); byte[] addressBytes = new byte[1 + payload.length + 4]; addressBytes[0] = (byte) version; System.arraycopy(payload, 0, addressBytes, 1, payload.length); byte[] checksum = Sha256Hash.hashTwice(addressBytes, 0, payload.length + 1); System.arraycopy(checksum, 0, addressBytes, payload.length + 1, 4); return Base58.encode(addressBytes); }  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 testEncodeChecked_address() throws Exception { String encoded = Base58.encodeChecked(111, new byte[LegacyAddress.LENGTH]); assertEquals("mfWxJ45yp2SFn7UciZyNpvDKrzbhyfKrY8", encoded); }
@Test public void testEncodeChecked_address() throws Exception { String encoded = Base58.encodeChecked(111, new byte[Address.LENGTH]); assertEquals("mfWxJ45yp2SFn7UciZyNpvDKrzbhyfKrY8", encoded); }
@Test public void testEncodeChecked_privateKey() throws Exception { String encoded = Base58.encodeChecked(128, new byte[32]); assertEquals("5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAbuatmU", encoded); }