code: private static int add1OrIncrement(String name, Map<String, Integer> map) {
          Integer old = map.get(name);
          int index = old == null ? 1 : old.intValue() + 1;
          map.put(name, Integer.valueOf(index));
          return index;
      }
docs: Increments the value name maps to or adds 1 as value if name
  isn't present inside the map.
  
  @return the new mapping for name