code: public static void register(FastProtocolId id, Method m) {
      synchronized (FastProtocolRegister.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 (m == null) {
          throw new RuntimeException("Method cannot be null");
        }
        Method registeredMethod = idToMethod.get(name);
        if (registeredMethod != null && registeredMethod != m) {
          throw new RuntimeException(
              "Trying to register different method with name: " + name);
        } else if (registeredMethod == m) {
          return; // quietly
        }
        LOG.info("FastProtocol - Registering method: " + name + " method: "
            + m.getName());
        idToMethod.put(name, m);
        methodToId.put(m, name);
      }
    }
docs: Registers a FastProtocol's method for a given id (name). The names should
  be unique, it is not possible to re-use a name for a different method.