throw new RuntimeException("Unknown type " + type);
throw new IllegalArgumentException("Unknown type " + type);
    public void dispatch(Object listener) {        // assume that it is the right listener type        FolderListener l = (FolderListener) listener;        if (type == CREATED) {            l.folderCreated(this);        } else if (type == DELETED) {            l.folderDeleted(this);        } else if (type == RENAMED) {            l.folderRenamed(this);        } else {            throw new RuntimeException("Unknown type " + type);        }    }