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

public List<EntityReference> removeApplication(String userId, long groupId, long applicationId) throws InsufficientPrivelegeException {
verifyUserCanUpdateGroup(userId, groupId);
appGroupEntryDao.removeApplication(groupId, applicationId);
Application app = applicationDao.getById(applicationId);
audit(groupId, userId, String.format(
"Removed application %s from group",
app != null
? app.name()
: applicationId),
EntityKind.APPLICATION,
Operation.REMOVE);
return appGroupEntryDao.getEntriesForGroup(groupId);
}
