### Question:
AccountState { public byte[] getEncoded() { if (rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeCoin(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); if (stateFlags != 0) { byte[] stateFlags = RLP.encodeInt(this.stateFlags); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash, stateFlags); } else { this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } } return rlpEncoded; } AccountState();  AccountState(BigInteger nonce, Coin balance);  AccountState(byte[] rlpData); int getStateFlags(); void setStateFlags(int s); BigInteger getNonce(); void setNonce(BigInteger nonce); byte[] getStateRoot(); void setStateRoot(byte[] stateRoot); void incrementNonce(); byte[] getCodeHash(); void setCodeHash(byte[] codeHash); Coin getBalance(); Coin addToBalance(Coin value); void subFromBalance(Coin value); byte[] getEncoded(); void setDirty(boolean dirty); void setDeleted(boolean deleted); boolean isDirty(); boolean isDeleted(); AccountState clone(); String toString(); Boolean isHibernated(); void hibernate(); void wakeUp(); static final byte[] EMPTY_DATA_HASH; }### Answer:
@Test public void testGetEncoded() { String expected = "f85e809" + "a0100000000000000000000000000000000000000000000000000" + "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"; AccountState acct = new AccountState(BigInteger.ZERO, new Coin(BigInteger.valueOf(2).pow(200))); assertEquals(expected, Hex.toHexString(acct.getEncoded())); }