code: private void updateTypeCounts(T type, int delta) {
          if (!typeCounts.containsKey(type)) {
              assert delta > 0 
                  : "removing edge type that was not originally present";
              typeCounts.put(type, delta);
          }
          else {
              int curCount = typeCounts.get(type);
              int newCount = curCount + delta;
              assert newCount >= 0 
                  : "removing edge type that was not originally present";
              if (newCount == 0)
                  typeCounts.remove(type);
              else
                  typeCounts.put(type, newCount);
          }
      }
docs: Updates how many edges have this type in the graph