class ApplicationRegistry {

	public Application register(Application app) {
		Validate.notNull(app, "Application must not be null");
		Validate.notNull(app.getId(), "ID must not be null");
		Validate.notNull(app.getUrl(), "URL must not be null");
		Validate.isTrue(checkUrl(app.getUrl()), "URL is not valid");
		return registry.put(app.getId(), app);
	}

}