code: public ResourceActivity getBlockingActivity(ResourceActivity activity) {
          ResourceList res = activity.getResourceList();
          for (ResourceActivity a : inProgress)
              if(res.isCollidingWith(a.getResourceList()))
                  return a;
          return null;
      }
docs: Of the activities that are in progress, return one that's blocking
  the given activity, or null if it's not blocked (and thus the
  given activity can be executed immediately.)