class BridgeSerializationUtils {

    public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) {
        if (data == null || data.length == 0) {
            return null;
        }
        RLPList rlpList = (RLPList)RLP.decode2(data).get(0);
        int serializedAddressesSize = rlpList.size() - 1;

        // serialized addresses size must be even - key, value pairs expected in sequence
        if (serializedAddressesSize % 2 != 0) {
            throw new RuntimeException("deserializeLockWhitelist: expected an even number of addresses, but odd given");
        }

        HashMap<Address, OneOffWhiteListEntry> entries = new HashMap<>(serializedAddressesSize / 2);
        for (int i = 0; i < serializedAddressesSize; i = i + 2) {
            byte[] hash160 = rlpList.get(i).getRLPData();
            byte[] maxTransferValueData = rlpList.get(i + 1).getRLPData();
            Address address = new Address(parameters, hash160);
            entries.put(address, new OneOffWhiteListEntry(address, Coin.valueOf(safeToBigInteger(maxTransferValueData).longValueExact())));
        }
        int disableBlockHeight = safeToBigInteger(rlpList.get(serializedAddressesSize).getRLPData()).intValueExact();
        return Pair.of(entries, disableBlockHeight);
    }

    private  BridgeSerializationUtils();

}