collections.add(collection);
	public void saveCollection(Collection collection)		throws PermissionDeniedException {		if (readOnly)			throw new PermissionDeniedException("database is read-only");		try {			if (collection.getId() < 0)				collection.setId(getNextCollectionId());			Value name;			try {				name = new Value(collection.getName().getBytes("UTF-8"));			} catch (UnsupportedEncodingException uee) {				LOG.debug(uee);				name = new Value(collection.getName().getBytes());			}			try {				final VariableByteOutputStream ostream =					new VariableByteOutputStream();				collection.write(ostream);				synchronized (collectionsDb) {					if (!collectionsDb.put(name, ostream.toByteArray())) {						LOG.debug(							"could not store collection data for "								+ collection.getName());						return;					}				}			} catch (IOException ioe) {				LOG.debug(ioe);			}		} catch (ReadOnlyException e) {			LOG.warn("database is read-only");		}	}