class BridgeSerializationUtils {

    public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) {
        Set<ReleaseTransactionSet.Entry> entries = new HashSet<>();

        if (data == null || data.length == 0) {
            return new ReleaseTransactionSet(entries);
        }

        RLPList rlpList = (RLPList)RLP.decode2(data).get(0);

        // Must have an even number of items
        if (rlpList.size() % 2 != 0) {
            throw new RuntimeException(String.format("Invalid serialized ReleaseTransactionSet. Expected an even number of elements, but got %d", rlpList.size()));
        }

        int n = rlpList.size() / 2;

        for (int k = 0; k < n; k++) {
            byte[] txPayload = rlpList.get(k * 2).getRLPData();
            UldTransaction tx =  new UldTransaction(networkParameters, txPayload);

            Long height = BigIntegers.fromUnsignedByteArray(rlpList.get(k * 2 + 1).getRLPData()).longValue();

            entries.add(new ReleaseTransactionSet.Entry(tx, height));
        }

        return new ReleaseTransactionSet(entries);
    }

    private  BridgeSerializationUtils();

}