code: public static void addEncodingHook(final Class<?> clazz, final Transformer transformer) {
          encodeHooks = true;
          List<Transformer> transformersForClass = encodingHooks.get(clazz);
          if (transformersForClass == null) {
              transformersForClass = new CopyOnWriteArrayList<Transformer>();
              encodingHooks.put(clazz, transformersForClass);
          }
          transformersForClass.add(transformer);
      }
docs: Registers a {@code Transformer} to use to encode a specific class into BSON.
  
  @param clazz       the class to be transformed during encoding
  @param transformer the transformer to use during encoding