code: public boolean connects(int vertex, T type) {
          BitSet types = inEdges.get(vertex);
          if (types != null && types.get(index(type)))
              return true;
          types = outEdges.get(vertex);
          return types != null && types.get(index(type));
      }
docs: {@inheritDoc}