code: public Serializer register(Class<?> type, int id, Class<? extends TypeSerializer> serializer) {
      registry.register(type, id, serializer);
      return this;
    }
docs: Registers a type serializer with an identifier.
  <p>
  The provided serializable type ID will be used to identify the serializable type during serialization and deserialization.
  When objects of the given {@code type} are serialized to a {@link Buffer}, the given type
  {@code id} will be written to the buffer in lieu of its class name. When the object is deserialized, the type {@code id}
  will be used to look up the class. It is essential that the given {@code type} be registered with the same {@code id}
  on all {@link Serializer} instances.
  <p>
  Because a custom {@link TypeSerializer} is provided, the registered {@code type} can be any class and does not have to
  implement any particular interface.
  <p>
  Internally, the provided class will be wrapped in a {@link DefaultTypeSerializerFactory}. The serializer
  class can be registered for more than one {@code type} class. The factory will instantiate a new
  {@link TypeSerializer} instance once for each type for which the serializer is registered per {@link Serializer}
  instance. If the {@code Serializer} instance is {@link Serializer#clone() cloned}, the serializer
  factory will be copied and a new {@link TypeSerializer} will be instantiated for the clone.
  
  @param type The serializable type.
  @param id The serializable type ID.
  @param serializer The serializer to register.
  @return The serializer instance.