private void _setValue(Owner target, Type value) throws Exception {
        final String setterId = target.getClass().getCanonicalName() + '#' + name;

        Method writeMethod = null;
        for (Method method : target.getClass().getMethods()) {
            // Find most specialized variant of setter because the method
            // can to have been overridden with concretized type
            if (method.getName().equals("set" + StringUtils.capitalize(name))
                    && (writeMethod == null
                            || writeMethod.getParameterTypes()[0].isAssignableFrom(method.getParameterTypes()[0]))) {
                writeMethod = method;
            }
        }

        if (writeMethod == null) {
            throw new IllegalStateException("Default value setter cannot find Property Descriptor for " + setterId);
        }

        Object o = value;
        if (multiple) {
            if (!(value instanceof Collection)) {
                throw new IllegalArgumentException(setterId + " should be a list.");
            }
            // if setter expect an Array, convert Collection to expected array type
            // Typically required for hudson.tools.ToolDescriptor.setInstallations
            // as java varargs unfortunately only supports Arrays, not all Iterable (sic)
            final Class c = writeMethod.getParameterTypes()[0];
            if (c.isArray()) {
                Collection collection = (Collection) value;
                o = collection.toArray((Object[]) Array.newInstance(type, collection.size()));

                // if setter expect a Set, convert Collection to Set
            } else if (c.isAssignableFrom(Set.class)) {
                o = new HashSet((Collection) value);
            }
        }

        writeMethod.invoke(target, o);
    }
Default Setter implementation based on JavaBean property write method.
plugin/src/main/java/io/jenkins/plugins/casc/Attribute.java