AccountState { public byte[] getEncoded() { if (rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; } AccountState();  AccountState(BigInteger nonce, BigInteger balance);  AccountState(byte[] rlpData); BigInteger getNonce(); void setNonce(BigInteger nonce); byte[] getStateRoot(); void setStateRoot(byte[] stateRoot); void incrementNonce(); byte[] getCodeHash(); void setCodeHash(byte[] codeHash); BigInteger getBalance(); BigInteger addToBalance(BigInteger value); void subFromBalance(BigInteger value); byte[] getEncoded(); void setDirty(boolean dirty); void setDeleted(boolean deleted); boolean isDirty(); boolean isDeleted(); AccountState clone(); String toString();  }
@Test public void testGetEncoded() { String expected = "f85e809" + "a0100000000000000000000000000000000000000000000000000" + "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"; AccountState acct = new AccountState(BigInteger.ZERO, BigInteger.valueOf(2).pow(200)); assertEquals(expected, Hex.toHexString(acct.getEncoded())); }