public <T> void setSerializer(Class<T> cls, Serializer<T> serializer) {
    addSerializer(cls, serializer);
  }
@Test
  public void testSetSerializer() {
    Fury fury =
        Fury.builder()
            .withLanguage(Language.JAVA)
            .withRefTracking(true)
            .requireClassRegistration(false)
            .build();
    ClassResolver classResolver = fury.getClassResolver();
    {
      classResolver.setSerializer(Foo.class, new ObjectSerializer<>(fury, Foo.class));
      ClassInfo classInfo = classResolver.getClassInfo(Foo.class);
      assertSame(classInfo.getSerializer().getClass(), ObjectSerializer.class);
      classResolver.setSerializer(Foo.class, new CompatibleSerializer<>(fury, Foo.class));
      Assert.assertSame(classResolver.getClassInfo(Foo.class), classInfo);
      assertSame(classInfo.getSerializer().getClass(), CompatibleSerializer.class);
    }
    {
      classResolver.register(Bar.class);
      ClassInfo classInfo = classResolver.getClassInfo(Bar.class);
      classResolver.setSerializer(Bar.class, new ObjectSerializer<>(fury, Bar.class));
      Assert.assertSame(classResolver.getClassInfo(Bar.class), classInfo);
      assertSame(classInfo.getSerializer().getClass(), ObjectSerializer.class);
      classResolver.setSerializer(Bar.class, new CompatibleSerializer<>(fury, Bar.class));
      Assert.assertSame(classResolver.getClassInfo(Bar.class), classInfo);
      assertSame(classInfo.getSerializer().getClass(), CompatibleSerializer.class);
    }
  }