code: private Map<ResourceType, MetricsTimeVaryingLong>
    createTypeToResourceCountMap(
        Collection<ResourceType> resourceTypes, String actionType) {
      Map<ResourceType, MetricsTimeVaryingLong> m =
          new HashMap<ResourceType, MetricsTimeVaryingLong>();
      for (ResourceType t : resourceTypes) {
        String name = (actionType + "_" + t).toLowerCase();
        MetricsTimeVaryingLong value = new MetricsTimeVaryingLong(name, registry);
        m.put(t, value);
      }
      return m;
    }
docs: Create a map of resource type -> cumulative counts.
  @param resourceTypes The resource types.
  @param actionType A string indicating granted, revoked, etc.
  @return The map.