@Override
    public <M extends Message> M deserialize(Class<M> clazz) throws IOException {
      if (deserializeIndex >= builder.getStateMessageCount()) {
        throw new IOException("Invalid state message index: " + deserializeIndex);
      }

      try {
        Any packedMessage = builder.getStateMessage(deserializeIndex++);
        return packedMessage.unpack(clazz);
      } catch (InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      }
    }
A serializer for our Procedures. Instead of the previous serializer, it uses the stateMessage
list to store the internal state of the Procedures.
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureUtil.java