public EnumSerializer(Fury fury, Class<Enum> cls) {
    super(fury, cls, false);
    if (cls.isEnum()) {
      enumConstants = cls.getEnumConstants();
    } else {
      Preconditions.checkArgument(Enum.class.isAssignableFrom(cls) && cls != Enum.class);
      @SuppressWarnings("unchecked")
      Class<Enum> enclosingClass = (Class<Enum>) cls.getEnclosingClass();
      Preconditions.checkNotNull(enclosingClass);
      Preconditions.checkArgument(enclosingClass.isEnum());
      enumConstants = enclosingClass.getEnumConstants();
    }
  }
@Test(dataProvider = "furyCopyConfig")
  public void testEnumSerializer(Fury fury) {
    copyCheckWithoutSame(fury, EnumFoo.A);
    copyCheckWithoutSame(fury, EnumFoo.B);
    copyCheckWithoutSame(fury, EnumSubClass.A);
    copyCheckWithoutSame(fury, EnumSubClass.B);
  }