private Resource getAssociatedResource() {
     ResourceAllocation<?> resourceAllocation = getAssociatedResourceAllocation();
     if (resourceAllocation != null) {
         List<Resource> resources = resourceAllocation.getAssociatedResources();
         if (resources != null && resources.size() >= 1) {
             return (Resource) resources.iterator().next();
         }
     }
     return null;
 }
 private void addAssociatedLimitingResourceQueueElement(Task task, ResourceAllocation<?> resourceAllocation) {
     LimitingResourceQueueElement element = LimitingResourceQueueElement.create();
     resourceAllocation.setLimitingResourceQueueElement(element);
     task.setResourceAllocation(resourceAllocation);
 }