code: @Override
      public byte[] serialize(final List<Command> commands) {
          final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
          final Output output = new Output(outStream);
          kryo.get().writeObject(output, commands);
          output.close();
          byte[] bytes = outStream.toByteArray();
          try {
              outStream.close();
          } catch (IOException e) {
              // This will not happen, as there is no real I/O. Everything happens in RAM.
              e.printStackTrace();
          }
          return bytes;
      }
docs: Serializes SyncronizeFX {@link Command}s to bytes.
  
  To deserialize them, use {@link KryoSerializer#deserialize(byte[])}. This method is thread safe.
  
  @param commands The commands to serialize.
  @return The commands in serialized form.