docs: public <A> A register(final boolean autoSync, final String name, final A rs) {
          checkResourceName(name);
          final Class<?> claz = rs.getClass();
          ResourceType rtype = claz.getAnnotation(ResourceType.class);
          if (rtype == null) {
              return (A) register(autoSync, name, claz, rs);
          } else {
              A old = null;
              A t = (A) register(autoSync, name, rtype.value(), rs);
              if (t != null) old = t;
              return old;
          }
      }