code: public void registerWritableType(short writableTypeKey, @NonNull Class<? extends Writable> writableClass) {
          if (map.containsKey(writableTypeKey)) {
              throw new UnsupportedOperationException("Key " + writableTypeKey + " is already registered to type "
                              + map.get(writableTypeKey) + " and cannot be registered to " + writableClass);
          }
  
          Constructor<? extends Writable> c;
          try {
              c = writableClass.getDeclaredConstructor();
          } catch (NoSuchMethodException e) {
              throw new RuntimeException("Cannot find no-arg constructor for class " + writableClass);
          }
  
          map.put(writableTypeKey, writableClass);
          constructorMap.put(writableTypeKey, c);
      }
docs: Register a writable class with a specific key (as a short). Note that key values must be unique for each type of
  Writable, as they are used as type information in certain types of serialisation. Consequently, an exception will
  be thrown If the key value is not unique or is already assigned.<br>
  Note that in general, this method needs to only be used for custom Writable types; Care should be taken to ensure
  that the given key does not change once assigned.
  
  @param writableTypeKey Key for the Writable
  @param writableClass   Class for the given key. Must have a no-arg constructor