public void register(Class<?> cls) {
    if (!extRegistry.registeredClassIdMap.containsKey(cls)) {
      while (extRegistry.classIdGenerator < registeredId2ClassInfo.length
          && registeredId2ClassInfo[extRegistry.classIdGenerator] != null) {
        extRegistry.classIdGenerator++;
      }
      register(cls, extRegistry.classIdGenerator);
    }
  }
@Test
  public void testRegisterClass() {
    Fury fury = Fury.builder().withLanguage(Language.JAVA).requireClassRegistration(false).build();
    ClassResolver classResolver = fury.getClassResolver();
    classResolver.register(org.apache.fury.test.bean.Foo.class);
    Assert.assertThrows(
        IllegalArgumentException.class,
        () -> classResolver.register(org.apache.fury.test.bean.Foo.class, 100));
    Assert.assertThrows(
        IllegalArgumentException.class,
        () -> classResolver.register(org.apache.fury.test.bean.Foo.createCompatibleClass1()));
    classResolver.register(Interface1.class, 200);
    Assert.assertThrows(
        IllegalArgumentException.class, () -> classResolver.register(Interface2.class, 200));
  }