code: public static void register(FastWritableId id, FastWritable fw) {
      synchronized (FastWritableRegister.class) {
        String name = id.toString();
        if (name.length() != NAME_LEN) {
          // we only allow two-byte serialization codes
          throw new RuntimeException("Code must be " + NAME_LEN + " bytes long");
        }
        if (fw == null) {
          throw new RuntimeException("Instance cannot be null");
        }
        FastWritable registeredWritable = register.get(name);
        if (registeredWritable != null && registeredWritable != fw) {
          throw new RuntimeException(
              "Trying to register different class with name: " + name);
        } else if (registeredWritable == fw) {
          return; //quietly
        } 
        LOG.info("FastWritable - Registering name: " + name);
        register.put(name, fw);
      }
    }
docs: Registers a FastWritable class for a given id (name). The names should be
  unique, it is not possible to re-use a name for a different class. If we
  re-register the same class, the object of the registered class must be the
  same (the same reference).