AccountAddress implements Serializable { public static AccountAddress fromBytes(byte[] publicKeyBytes) { return new AccountAddress(publicKeyBytes); } private  AccountAddress(byte[] publicKeyBytes); byte[] getBytes(); static AccountAddress fromHexString(String publicKeyHexString); static AccountAddress fromBytes(byte[] publicKeyBytes); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final AccountAddress EMPTY_ADDRESS; }
@Test public void testAccountAddressFromBytes() { PublicKey publicKeyMinting = AppServiceProvider.getShardingService().getPublicKeyForMinting(new Shard(0)); AccountAddress accountAddress = AccountAddress.fromBytes(publicKeyMinting.getValue()); Assert.assertTrue(accountAddress != null); }
@Test(expected = IllegalArgumentException.class) public void testAccountAddressFromNullBytesShouldThrowException() { AccountAddress.fromBytes(null); Assert.fail(); }