@Override
public Map<ProjectRole, List<ProjectPermission>> listProjectPermissionsAsMap(long projectId) {
List<ProjectPermission> projectPermissions = listProjectPermissions(projectId);
//
ProjectRole prevProjectRole = null;
List<ProjectPermission> projectPermissionList = new ArrayList<ProjectPermission>();
Map<ProjectRole, List<ProjectPermission>> projectRolePermissionMap = new LinkedHashMap<ProjectRole, List<ProjectPermission>>();
for(ProjectPermission projectPermission : projectPermissions) {
//
if(prevProjectRole!=null && prevProjectRole.getId()!=projectPermission.getProjectRoleId()) {
projectRolePermissionMap.put(prevProjectRole, projectPermissionList);
projectPermissionList = new ArrayList<ProjectPermission>();
}
//
projectPermissionList.add(projectPermission);