code: @Override
    public byte[] encode(final T obj) {
      final Encoder<T> encoder = (Encoder<T>) clazzToEncoderMap.get(obj.getClass());
      if (encoder == null) {
        throw new RemoteRuntimeException("Encoder for " + obj.getClass() + " not known.");
      }
  
      final WakeTuplePBuf.Builder tupleBuilder = WakeTuplePBuf.newBuilder();
      tupleBuilder.setClassName(obj.getClass().getName());
      tupleBuilder.setData(ByteString.copyFrom(encoder.encode(obj)));
      return tupleBuilder.build().toByteArray();
    }
docs: Encodes an object to a byte array.
  
  @param obj an object to be encoded