@Override
  public void set(@NotNull Object host, @Nullable Object value) {
    if (writeMethod == null) {
      throw new SerializationException(host.getClass().getName() + "::" + name + " lacks a setter");
    }
    try {
      writeMethod.invoke(host, value);
    }
    catch (IllegalAccessException e) {
      throw new SerializationException(e);
    }
    catch (InvocationTargetException e) {
      Throwable cause = e.getCause();
      // see KotlinXmlSerializerTest.nullInMap
      if (cause instanceof NullPointerException &&
          genericType instanceof Class &&
          ((Class<?>)genericType).isEnum() &&
          cause.getMessage().contains("Parameter specified as non-null is null:")) {
        Object[] constants = ((Class<?>)genericType).getEnumConstants();
        if (constants.length > 0) {
          try {
            LOG.warn("Cannot set enum value, will be set to first enum value", e);
            writeMethod.invoke(host, constants[0]);
            return;
          }
          catch (IllegalAccessException | InvocationTargetException e1) {
            throw new SerializationException(e);
          }
        }
      }

      throw new SerializationException(cause);
    }
  }
@Override
  public void set(@NotNull Object host, @Nullable Object value)