code: private List<ResourceGrant> getGrantsYoungerThan(
        long maxRunningTime, ResourceType type) {
      long now = ClusterManager.clock.getTime();
      List<ResourceGrant> candidates = new ArrayList<ResourceGrant>();
      for (ResourceGrant grant : getGrants()) {
        if (now - grant.getGrantedTime() < maxRunningTime &&
            type.equals(grant.getType())) {
          candidates.add(grant);
        }
      }
      return candidates;
    }
docs: Get all the grants that have been running for less than maxRunningTime
  @param maxRunningTime the threshold to check against
  @param type the type of the grants to return
  @return the list of grants of a given type that have been granted less
  than maxRunningTime ago