code: @Override
    public byte[] encode(final RemoteEvent<T> obj) {
      if (obj.getEvent() == null) {
        throw new RemoteRuntimeException("Event is null");
      }
  
      final WakeMessagePBuf.Builder builder = WakeMessagePBuf.newBuilder();
      builder.setSeq(obj.getSeq());
      builder.setData(ByteString.copyFrom(encoder.encode(obj.getEvent())));
  
      return builder.build().toByteArray();
    }
docs: Encodes the remote event object to bytes.
  
  @param obj the remote event
  @return bytes
  @throws RemoteRuntimeException