public List<EntityReference> addApplication(String userId, long groupId, long applicationId) throws InsufficientPrivelegeException {
verifyUserCanUpdateGroup(userId, groupId);
Application app = applicationDao.getById(applicationId);
if (app != null) {
appGroupEntryDao.addApplication(groupId, applicationId);
<BUG>audit(groupId, userId, String.format("Added application %s to group", app.name()));
</BUG>
}
return appGroupEntryDao.getEntriesForGroup(groupId);
}

public List<EntityReference> addApplication(String userId, long groupId, long applicationId) throws InsufficientPrivelegeException {
verifyUserCanUpdateGroup(userId, groupId);
Application app = applicationDao.getById(applicationId);
if (app != null) {
appGroupEntryDao.addApplication(groupId, applicationId);
audit(groupId, userId, String.format("Added application %s to group", app.name()), EntityKind.APPLICATION, Operation.ADD);
}
return appGroupEntryDao.getEntriesForGroup(groupId);
}
