private <T> Property<T> prepare(String key, Property<T> property, T initialValue) {
        final ChangeListener<T> change = (ob, oldValue, newValue) -> {
            if (newValue != null) {
                config.put(key, newValue);
            } else {
                config.remove(key);
            }
            
            invalidate();
        };
        
        property.setValue(initialValue);
        property.addListener(change);
        change.changed(property, null, initialValue);
        return property;
    }
Adds a listener to the specified property so that changes to it are
reflected down to the source map.

@param <T>           the type of the property
@param key           the key of the property
@param property      the property to listen to
@param initialValue  the initial value of this property
@return              the same property but with listener attached
tool-parent/tool-config/src/main/java/com/speedment/tool/config/AbstractDocumentProperty.java