@Test
public void deserialize() throws DeserializationException {

    byte[] data = Numeric.hexStringToByteArray(""
            + Numeric.reverseHexString(acctScriptHash.toString())
            + "31" // calledByEntry, custom contracts and custom groups scope
            + "02" // array length 2
            + Numeric.reverseHexString(contract1.toString())
            + Numeric.reverseHexString(contract2.toString())
            + "02" // array length 2
            + Numeric.toHexStringNoPrefix(groupPubKey1.toArray())
            + Numeric.toHexStringNoPrefix(groupPubKey2.toArray()));
    Signer c = NeoSerializableInterface.from(data, Signer.class);
    assertThat(c.getScriptHash(), is(acctScriptHash));
    assertThat(c.getScopes(), containsInAnyOrder(
            WitnessScope.CUSTOM_CONTRACTS,
            WitnessScope.CALLED_BY_ENTRY,
            WitnessScope.CUSTOM_GROUPS));
    assertThat(c.getAllowedContracts(), containsInAnyOrder(contract1, contract2));
    assertThat(c.getAllowedGroups(), containsInAnyOrder(groupPubKey1, groupPubKey2));
}