code: private boolean add(TIntObjectHashMap<BitSet> edges, int i, T type) {
          BitSet types = edges.get(i);
          // If there weren't any edges to this vertex, then special case the
          // creation and return true.
          if (types == null) {
              types = new BitSet();
              edges.put(i, types);
              types.set(index(type));
              connected.add(i);
              size++;
              return true;
          }
          // Otherwise, lookup the type's index and see if it already exists in
          // the bitset, indicating the edge does too
          int index = index(type);
          if (!types.get(index)) {
              types.set(index);
              connected.add(i);
              size++;
              return true;            
          }
          // If the type was already there, then return false because the edge
          // already exists
          return false;
      }
docs: Adds an edge to the spectied set that connectes t{@code i} according to
  the given type, or returns {@code false} if the edge already existed.