public void set(String key, Object value) {
        if (key == null) {
            throw new IllegalArgumentException("null key");
        }
        if (key.equals("")) {
            throw new IllegalArgumentException("key is an empty string");
        }
        if (!entries.containsKey(key)) {
            throw new IllegalArgumentException(
                    "property " + key + " has not been defined");
        }
        Entry entry = entries.get(key);
        if (value != null && !entry.type.isInstance(value)) {
            throw new ClassCastException(
                    "value " + value + " is not a " + entry.type.getName());
        }
        if ((value == null && entry.currentValue != null)
                || (value != null && !value.equals(entry.currentValue))) {
            
            entry.currentValue = value;
            unsaved = true;
        }
    }